зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug 27382 (ownerDocument of orphan text and attr nodes is null). r+sr=bz
This commit is contained in:
Родитель
e1e2c6f9fa
Коммит
6226b16caf
|
@ -44,6 +44,8 @@
|
|||
#include "nsContentUtils.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsDOMString.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
@ -339,18 +341,23 @@ nsDOMAttribute::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
|
|||
NS_IMETHODIMP
|
||||
nsDOMAttribute::GetOwnerDocument(nsIDOMDocument** aOwnerDocument)
|
||||
{
|
||||
nsresult result = NS_OK;
|
||||
*aOwnerDocument = nsnull;
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
if (mContent) {
|
||||
nsCOMPtr<nsIDOMNode> node = do_QueryInterface(mContent, &result);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = node->GetOwnerDocument(aOwnerDocument);
|
||||
nsCOMPtr<nsIDOMNode> node = do_QueryInterface(mContent, &rv);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = node->GetOwnerDocument(aOwnerDocument);
|
||||
}
|
||||
}
|
||||
else {
|
||||
*aOwnerDocument = nsnull;
|
||||
nsIDocument *document = mNodeInfo->GetDocument();
|
||||
if (document) {
|
||||
rv = CallQueryInterface(document, aOwnerDocument);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
Загрузка…
Ссылка в новой задаче