зеркало из https://github.com/mozilla/pjs.git
Fix small regression from the fix for bug 346362 (document.evaluate(.., contextNode, ...) should raise an exception if document != contextNode.ownerDocument), properly deal with a document as contextNode. r/sr=bz.
This commit is contained in:
Родитель
a708c567b8
Коммит
5dfe02014c
|
@ -96,11 +96,13 @@ nsXPathExpression::EvaluateWithContext(nsIDOMNode *aContextNode,
|
|||
if (!nsContentUtils::CanCallerAccess(aContextNode))
|
||||
return NS_ERROR_DOM_SECURITY_ERR;
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> contextDocument;
|
||||
aContextNode->GetOwnerDocument(getter_AddRefs(contextDocument));
|
||||
if (mDocument && mDocument != aContextNode) {
|
||||
nsCOMPtr<nsIDOMDocument> contextDocument;
|
||||
aContextNode->GetOwnerDocument(getter_AddRefs(contextDocument));
|
||||
|
||||
if (mDocument && mDocument != contextDocument) {
|
||||
return NS_ERROR_DOM_WRONG_DOCUMENT_ERR;
|
||||
if (mDocument != contextDocument) {
|
||||
return NS_ERROR_DOM_WRONG_DOCUMENT_ERR;
|
||||
}
|
||||
}
|
||||
|
||||
nsresult rv;
|
||||
|
|
Загрузка…
Ссылка в новой задаче