diff options
Diffstat (limited to 'dom/events/EventDispatcher.cpp')
-rw-r--r-- | dom/events/EventDispatcher.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/dom/events/EventDispatcher.cpp b/dom/events/EventDispatcher.cpp index 9a48ca2a90..e2b5699241 100644 --- a/dom/events/EventDispatcher.cpp +++ b/dom/events/EventDispatcher.cpp @@ -872,6 +872,7 @@ EventDispatcher::Dispatch(nsISupports* aTarget, preVisitor.mTargetInKnownToBeHandledScope = preVisitor.mEvent->mTarget; topEtci = parentEtci; } else { + bool ignoreBecauseOfShadowDOM = preVisitor.mIgnoreBecauseOfShadowDOM; nsCOMPtr<nsINode> disabledTarget = do_QueryInterface(parentTarget); parentEtci = MayRetargetToChromeIfCanNotHandleEvent(chain, preVisitor, @@ -882,7 +883,11 @@ EventDispatcher::Dispatch(nsISupports* aTarget, preVisitor.mTargetInKnownToBeHandledScope = preVisitor.mEvent->mTarget; EventTargetChainItem* item = EventTargetChainItem::GetFirstCanHandleEventTarget(chain); - item->SetNewTarget(parentTarget); + if (!ignoreBecauseOfShadowDOM) { + // If we ignored the target because of Shadow DOM retargeting, we + // shouldn't treat the target to be in the event path at all. + item->SetNewTarget(parentTarget); + } topEtci = parentEtci; continue; } |