Issue #2135 - Bug 1413102 (Follow-up): Ignore current target because of shadow DOM retargeting

Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1466581
This commit is contained in:
FranklinDM 2023-03-04 02:23:31 +08:00 committed by roytam1
commit 1bb2009f61
3 changed files with 18 additions and 4 deletions

View file

@ -995,7 +995,7 @@ nsIContent::GetEventTargetParent(EventChainPreVisitor& aVisitor)
// Step 4.
// "If target is relatedTarget and target is not event's
// relatedTarget, then return true."
aVisitor.IgnoreCurrentTarget();
aVisitor.IgnoreCurrentTargetBecauseOfShadowDOMRetargeting();
// Old code relies on mTarget to point to the first element which
// was not added to the event target chain because of mCanHandle
// being false, but in Shadow DOM case mTarget really should
@ -1034,7 +1034,7 @@ nsIContent::GetEventTargetParent(EventChainPreVisitor& aVisitor)
// Step 11.5
// "Otherwise, if parent and relatedTarget are identical, then set
// parent to null."
aVisitor.IgnoreCurrentTarget();
aVisitor.IgnoreCurrentTargetBecauseOfShadowDOMRetargeting();
// Old code relies on mTarget to point to the first element which
// was not added to the event target chain because of mCanHandle
// being false, but in Shadow DOM case mTarget really should