Bug 380716, Crash [@ nsContentUtils::ContentIsDescendantOf], r+sr=jst

This commit is contained in:
Olli.Pettay@helsinki.fi 2007-05-18 03:23:45 -07:00
Родитель 6b77e511dd
Коммит 66b98ebaff
1 изменённых файлов: 11 добавлений и 7 удалений

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

@ -1904,13 +1904,17 @@ nsGenericElement::doPreHandleEvent(nsIContent* aContent,
(aVisitor.mEvent->originalTarget == aContent &&
(aVisitor.mRelatedTargetIsInAnon = IsInAnonContent(relatedTarget)))) {
nsIContent* nonAnon = FindFirstNonAnonContent(aContent);
nsIContent* nonAnonRelated = FindFirstNonAnonContent(relatedTarget);
if (nonAnon == nonAnonRelated ||
nsContentUtils::ContentIsDescendantOf(nonAnonRelated, nonAnon)) {
aVisitor.mParentTarget = nsnull;
// Event should not propagate to non-anon content.
aVisitor.mCanHandle = isAnonForEvents;
return NS_OK;
if (nonAnon) {
nsIContent* nonAnonRelated = FindFirstNonAnonContent(relatedTarget);
if (nonAnonRelated) {
if (nonAnon == nonAnonRelated ||
nsContentUtils::ContentIsDescendantOf(nonAnonRelated, nonAnon)) {
aVisitor.mParentTarget = nsnull;
// Event should not propagate to non-anon content.
aVisitor.mCanHandle = isAnonForEvents;
return NS_OK;
}
}
}
}
}