follow-up rev 24572438, targetInKnownToBeHandledScope can be null

This commit is contained in:
roytam1 2023-03-20 07:34:56 +08:00
commit af28af9f85

View file

@ -1022,7 +1022,7 @@ nsIContent::GetEventTargetParent(EventChainPreVisitor& aVisitor)
nsContentUtils::Retarget(relatedTargetAsNode, this);
nsCOMPtr<nsINode> targetInKnownToBeHandledScope =
FindChromeAccessOnlySubtreeOwner(aVisitor.mTargetInKnownToBeHandledScope);
if (nsContentUtils::ContentIsShadowIncludingDescendantOf(
if (targetInKnownToBeHandledScope && nsContentUtils::ContentIsShadowIncludingDescendantOf(
this, targetInKnownToBeHandledScope->SubtreeRoot())) {
// Part of step 11.4.
// "If target's root is a shadow-including inclusive ancestor of