Skip to content

Commit

Permalink
Cherry-pick 270295@main (6fa5837). https://bugs.webkit.org/show_bug.c…
Browse files Browse the repository at this point in the history
…gi?id=264380

    nullptr crash in EventPath::eventTargetRespectingTargetRules via EventPath::buildPath
    https://bugs.webkit.org/show_bug.cgi?id=264276
    <rdar://117902151>

    Reviewed by Chris Dumez.

    Add a nullptr check where the crash occurs. Also add a debug assert since this node
    should never be nullptr in theory.

    * Source/WebCore/dom/EventPath.cpp:
    (WebCore::EventPath::buildPath):

    Canonical link: https://commits.webkit.org/270295@main
  • Loading branch information
rniwa authored and aperezdc committed Jan 25, 2024
1 parent 45dfc44 commit 549cfbd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/WebCore/dom/EventPath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ void EventPath::buildPath(Node& originalTarget, Event& event)
if (!shouldEventCrossShadowBoundary(event, shadowRoot, originalTarget))
return;
node = shadowRoot.host();
ASSERT(node);
if (!node)
return;
if (shadowRoot.mode() != ShadowRootMode::Open)
closedShadowDepth--;
if (exitingShadowTreeOfTarget)
Expand Down

0 comments on commit 549cfbd

Please sign in to comment.