Implement Event propagation across shadow roots (#34884)

* Implement Event.composed flag

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Allow composed events to pass shadow boundaries

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update WPT expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-01-22 16:25:16 +01:00 committed by GitHub
parent aed7e8cefd
commit 1b882f2729
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 89 additions and 144 deletions

View file

@ -1,3 +0,0 @@
[event-global-extra.window.html]
[window.event should not be affected by nodes moving post-dispatch]
expected: FAIL

View file

@ -1,7 +1,3 @@
[event-global.html]
expected: TIMEOUT
[window.event is undefined if the target is in a shadow tree (event dispatched inside shadow tree)]
expected: TIMEOUT
[window.event is undefined inside window.onerror if the target is in a shadow tree (ErrorEvent dispatched inside shadow tree)]
expected: FAIL

View file

@ -5,15 +5,6 @@
expected: ERROR
[idlharness.any.worker.html]
[Event interface: attribute composed]
expected: FAIL
[Event interface: new Event("foo") must inherit property "composed" with the proper type]
expected: FAIL
[Event interface: new CustomEvent("foo") must inherit property "composed" with the proper type]
expected: FAIL
[AbortController interface: attribute signal]
expected: FAIL

View file

@ -8,9 +8,6 @@
[AbortSignal must be primary interface of new AbortController().signal]
expected: FAIL
[Event interface: attribute composed]
expected: FAIL
[AbortSignal interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
@ -32,9 +29,6 @@
[AbortSignal interface object name]
expected: FAIL
[Event interface: new CustomEvent("foo") must inherit property "composed" with the proper type]
expected: FAIL
[EventTarget interface: new AbortController().signal must inherit property "removeEventListener(DOMString, EventListener?, optional (EventListenerOptions or boolean))" with the proper type]
expected: FAIL
@ -116,9 +110,6 @@
[AbortSignal interface: existence and properties of interface prototype object]
expected: FAIL
[Event interface: new Event("foo") must inherit property "composed" with the proper type]
expected: FAIL
[Element interface: operation remove()]
expected: FAIL
@ -146,9 +137,6 @@
[Document interface: operation append((Node or DOMString)...)]
expected: FAIL
[Event interface: document.createEvent("Event") must inherit property "composed" with the proper type]
expected: FAIL
[DocumentType interface: operation remove()]
expected: FAIL

View file

@ -1,16 +1,4 @@
[Extensions-to-Event-Interface.html]
[composed on EventInit must default to false]
expected: FAIL
[composed on EventInit must set the composed flag]
expected: FAIL
[The event must propagate out of open mode shadow boundaries when the composed flag is set]
expected: FAIL
[The event must propagate out of closed mode shadow boundaries when the composed flag is set]
expected: FAIL
[The event must not propagate out of open mode shadow tree of the target but must propagate out of inner shadow trees when the scoped flag is set]
expected: FAIL

View file

@ -1,10 +1,4 @@
[capturing-and-bubbling-event-listeners-across-shadow-trees.html]
[Capturing event listeners should be invoked before bubbling event listeners when an event is dispatched inside a shadow tree]
expected: FAIL
[Capturing event listeners should be invoked before bubbling event listeners when an event is dispatched inside a doubly nested shadow tree]
expected: FAIL
[Capturing event listeners should be invoked before bubbling event listeners when an event is dispatched via a slot]
expected: FAIL

View file

@ -1,7 +0,0 @@
[event-composed-path-after-dom-mutation.html]
expected: TIMEOUT
[Event.composedPath() should return the same result even if DOM is mutated (1/2)]
expected: TIMEOUT
[Event.composedPath() should return the same result even if DOM is mutated (2/2)]
expected: TIMEOUT

View file

@ -1,22 +1,4 @@
[event-composed-path.html]
[Event Path with an open ShadowRoot.]
expected: FAIL
[Event Path with a closed ShadowRoot.]
expected: FAIL
[Event Path with nested ShadowRoots: open > open.]
expected: FAIL
[Event Path with nested ShadowRoots: open > closed.]
expected: FAIL
[Event Path with nested ShadowRoots: closed > open.]
expected: FAIL
[Event Path with nested ShadowRoots: closed > closed.]
expected: FAIL
[Event Path with a slot in an open Shadow Root.]
expected: FAIL

View file

@ -1,13 +1,4 @@
[event-composed.html]
[A new events composed value should be set to false by default.]
expected: FAIL
[Users should be able to set a composed value.]
expected: FAIL
[An event should not be scoped if composed is specified]
expected: FAIL
[A synthetic MouseEvent with composed=true should not be scoped]
expected: FAIL

View file

@ -1,3 +0,0 @@
[event-dispatch-order.tentative.html]
[Event dispatch order: capture listerns should be called in capturing phase at a shadow host]
expected: FAIL

View file

@ -1,36 +0,0 @@
[event-inside-shadow-tree.html]
[Firing an event inside a grand child of a detached open mode shadow tree]
expected: FAIL
[Firing an event inside a grand child of a detached closed mode shadow tree]
expected: FAIL
[Firing an event inside a grand child of an in-document open mode shadow tree]
expected: FAIL
[Firing an event inside a grand child of an in-document closed mode shadow tree]
expected: FAIL
[Firing an event inside a detached open mode shadow tree inside open mode shadow tree]
expected: FAIL
[Firing an event inside a detached open mode shadow tree inside closed mode shadow tree]
expected: FAIL
[Firing an event inside a detached closed mode shadow tree inside open mode shadow tree]
expected: FAIL
[Firing an event inside a detached closed mode shadow tree inside closed mode shadow tree]
expected: FAIL
[Firing an event inside an in-document open mode shadow tree inside open mode shadow tree]
expected: FAIL
[Firing an event inside an in-document open mode shadow tree inside closed mode shadow tree]
expected: FAIL
[Firing an event inside an in-document closed mode shadow tree inside open mode shadow tree]
expected: FAIL
[Firing an event inside an in-document closed mode shadow tree inside closed mode shadow tree]
expected: FAIL

View file

@ -1,13 +1,4 @@
[event-post-dispatch.html]
[Event properties post dispatch with an open ShadowRoot (composed: true).]
expected: FAIL
[Event properties post dispatch with a closed ShadowRoot (composed: true).]
expected: FAIL
[Event properties post dispatch with nested ShadowRoots (composed: true).]
expected: FAIL
[Event properties post dispatch with relatedTarget in the same shadow tree. (composed: true)]
expected: FAIL