зеркало из https://github.com/mozilla/pjs.git
Fixing nsbeta2+ bug 41588, accessing document.documentElement on an empty document in JS threw a NS_ERROR_FAILURE exception in stead of just returning null. r=heikki@citec.fi
This commit is contained in:
Родитель
e8151eee69
Коммит
c06191a726
|
@ -2058,11 +2058,13 @@ nsDocument::GetDocumentElement(nsIDOMElement** aDocumentElement)
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
nsresult res = NS_ERROR_FAILURE;
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (nsnull != mRootContent) {
|
||||
res = mRootContent->QueryInterface(NS_GET_IID(nsIDOMElement), (void**)aDocumentElement);
|
||||
NS_ASSERTION(NS_OK == res, "Must be a DOM Element");
|
||||
} else {
|
||||
*aDocumentElement = nsnull;
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
|
@ -2058,11 +2058,13 @@ nsDocument::GetDocumentElement(nsIDOMElement** aDocumentElement)
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
nsresult res = NS_ERROR_FAILURE;
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (nsnull != mRootContent) {
|
||||
res = mRootContent->QueryInterface(NS_GET_IID(nsIDOMElement), (void**)aDocumentElement);
|
||||
NS_ASSERTION(NS_OK == res, "Must be a DOM Element");
|
||||
} else {
|
||||
*aDocumentElement = nsnull;
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
Загрузка…
Ссылка в новой задаче