Bug 421486, automatic unwanted scrolling, r+sr=sicking

This commit is contained in:
Olli.Pettay@helsinki.fi 2008-03-12 03:26:12 -07:00
Родитель 5874ee4da8
Коммит fcaffd627d
1 изменённых файлов: 11 добавлений и 2 удалений

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

@ -2233,6 +2233,15 @@ nsGenericElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
return nsGenericElement::doPreHandleEvent(this, aVisitor);
}
static nsIContent*
FindFirstNonNativeAnonymousAncestor(nsIContent* aContent)
{
while (aContent && aContent->IsNativeAnonymous()) {
aContent = aContent->GetParent();
}
return aContent;
}
nsresult
nsGenericElement::doPreHandleEvent(nsIContent* aContent,
nsEventChainPreVisitor& aVisitor)
@ -2260,10 +2269,10 @@ nsGenericElement::doPreHandleEvent(nsIContent* aContent,
(aVisitor.mEvent->originalTarget == aContent &&
(aVisitor.mRelatedTargetIsInAnon =
relatedTarget->IsInNativeAnonymousSubtree()))) {
nsIContent* nonAnon = aContent->FindFirstNonNativeAnonymous();
nsIContent* nonAnon = FindFirstNonNativeAnonymousAncestor(aContent);
if (nonAnon) {
nsIContent* nonAnonRelated =
relatedTarget->FindFirstNonNativeAnonymous();
FindFirstNonNativeAnonymousAncestor(relatedTarget);
if (nonAnonRelated) {
if (nonAnon == nonAnonRelated ||
nsContentUtils::ContentIsDescendantOf(nonAnonRelated, nonAnon)) {