Skip to content

Commit

Permalink
add comments and formatting in mozilla upstream "bug 1440809, ensure …
Browse files Browse the repository at this point in the history
…we don't try to treat non-DOM-Node event targets as such, r=masayuki (89c8025537a5)"
  • Loading branch information
roytam1 committed Mar 20, 2023
1 parent af28af9 commit 64329d4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dom/base/FragmentOrElement.cpp
Expand Up @@ -1022,7 +1022,12 @@ nsIContent::GetEventTargetParent(EventChainPreVisitor& aVisitor)
nsContentUtils::Retarget(relatedTargetAsNode, this);
nsCOMPtr<nsINode> targetInKnownToBeHandledScope =
FindChromeAccessOnlySubtreeOwner(aVisitor.mTargetInKnownToBeHandledScope);
if (targetInKnownToBeHandledScope && nsContentUtils::ContentIsShadowIncludingDescendantOf(
// If aVisitor.mTargetInKnownToBeHandledScope wasn't nsINode,
// targetInKnownToBeHandledScope will be null. This may happen when
// dispatching event to Window object in a content page and
// propagating the event to a chrome Element.
if (targetInKnownToBeHandledScope &&
nsContentUtils::ContentIsShadowIncludingDescendantOf(
this, targetInKnownToBeHandledScope->SubtreeRoot())) {
// Part of step 11.4.
// "If target's root is a shadow-including inclusive ancestor of
Expand Down

0 comments on commit 64329d4

Please sign in to comment.