[webkit-changes] [WebKit/WebKit] 0c1b97: Assertion hit under EventTarget::fireEventListeners()

Chris Dumez noreply at github.com
Tue Nov 8 09:02:49 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0c1b973a7433fde1d87c8c81e835ba31fc30fe96
      https://github.com/WebKit/WebKit/commit/0c1b973a7433fde1d87c8c81e835ba31fc30fe96
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2022-11-08 (Tue, 08 Nov 2022)

  Changed paths:
    A LayoutTests/svg/use-element-updateUserAgentShadowTree-crash-expected.txt
    A LayoutTests/svg/use-element-updateUserAgentShadowTree-crash.html
    M Source/WebCore/dom/EventTarget.cpp

  Log Message:
  -----------
  Assertion hit under EventTarget::fireEventListeners()
https://bugs.webkit.org/show_bug.cgi?id=247580
rdar://98238259

Reviewed by Ryosuke Niwa.

We were hitting the `ScriptDisallowedScope::isScriptAllowedInMainThread()`
assertion under EventTarget::fireEventListeners(). However, the caller is
SVGUseElement::updateUserAgentShadowTree() which has a EventAllowedScope to
allow event dispatch in the shadow root subtree.

I updated the assertion in fireEventListeners() to rely on
isEventDispatchAllowedInSubtree() instead when the EventTarget is a Node,
so that the ScriptDisallowedScope is taken into account.

* LayoutTests/svg/use-element-updateUserAgentShadowTree-crash-expected.txt: Added.
* LayoutTests/svg/use-element-updateUserAgentShadowTree-crash.html: Added.
* Source/WebCore/dom/EventTarget.cpp:
(WebCore::EventTarget::fireEventListeners):

Canonical link: https://commits.webkit.org/256451@main




More information about the webkit-changes mailing list