Bug 571246 - Crash @nsCoreUtils::IsAncestorOf(nsINode*,nsINode*,nsINode*), r=bz, davidb

This commit is contained in:
Alexander Surkov 2010-06-11 17:23:04 +09:00
Родитель 037e2ec128
Коммит 1cca3ad2d5
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -320,7 +320,8 @@ nsCoreUtils::IsAncestorOf(nsINode *aPossibleAncestorNode,
NS_ENSURE_TRUE(aPossibleAncestorNode && aPossibleDescendantNode, PR_FALSE); NS_ENSURE_TRUE(aPossibleAncestorNode && aPossibleDescendantNode, PR_FALSE);
nsINode *parentNode = aPossibleDescendantNode; nsINode *parentNode = aPossibleDescendantNode;
while ((parentNode = parentNode->GetNodeParent()) != aRootNode) { while ((parentNode = parentNode->GetNodeParent()) &&
parentNode != aRootNode) {
if (parentNode == aPossibleAncestorNode) if (parentNode == aPossibleAncestorNode)
return PR_TRUE; return PR_TRUE;
} }