Don't register unconnected shadow roots with their owner document (#34361)

* Don't falsely register Shadow Roots as connected

Previously, a shadowroot would be registered as connected
during the shadow hosts bind_to_tree call, even if the host
was being bound to an element that was not itself
connected to a document.

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

* Update WPT expectations

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

* Move bind/unbind methods into a VirtualMethod impl

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

* Add DocumentFragment/Shadowroot to vtable_for

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 2024-12-02 19:33:25 +01:00 committed by GitHub
parent 888a93af47
commit f1e89c58a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 161 additions and 27 deletions

View file

@ -1,5 +1,4 @@
[CustomElementRegistry.html]
expected: CRASH
[customElements.define must upgrade elements in the shadow-including tree order]
expected: FAIL

View file

@ -1,4 +1,3 @@
[upgrade.html]
expected: CRASH
[Two elements as shadow-including descendants (and not descendants) of the upgraded node]
expected: FAIL

View file

@ -1,5 +1,4 @@
[radio-disconnected-group-owner.html]
expected: CRASH
[Removed elements are moved into separate radio groups.]
expected: FAIL

View file

@ -1,2 +1,6 @@
[dialog-focus-shadow-double-nested.html]
expected: CRASH
[show()]
expected: FAIL
[showModal()]
expected: FAIL

View file

@ -1,2 +1,33 @@
[Extensions-to-Event-Interface.html]
expected: CRASH
[composedPath() must return an empty array when the event is no longer dispatched]
expected: FAIL
[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
[The event must not propagate out of closed mode shadow tree of the target but must propagate out of inner shadow trees when the scoped flag is set]
expected: FAIL
[The event must propagate out of open mode shadow tree in which the relative target and the relative related target are the same]
expected: FAIL
[The event must propagate out of closed mode shadow tree in which the relative target and the relative related target are the same]
expected: FAIL
[composedPath() must contain and only contain the unclosed nodes of target in open mode shadow trees]
expected: FAIL
[composedPath() must contain and only contain the unclosed nodes of target in closed mode shadow trees]
expected: FAIL

View file

@ -1,2 +1,54 @@
[event-with-related-target.html]
expected: CRASH
[Firing an event at B1a with relatedNode at B1 with open mode shadow trees]
expected: FAIL
[Firing an event at B1a with relatedNode at B1 with closed mode shadow trees]
expected: FAIL
[Firing an event at B1a with relatedNode at B1b1 with open mode shadow trees]
expected: FAIL
[Firing an event at B1a with relatedNode at B1b1 with closed mode shadow trees]
expected: FAIL
[Firing an event at B1b1 with relatedNode at B1a with open mode shadow trees]
expected: FAIL
[Firing an event at B1b1 with relatedNode at B1a with closed mode shadow trees]
expected: FAIL
[Firing an event at B1a with relatedNode at D1 with open mode shadow trees]
expected: FAIL
[Firing an event at B1a with relatedNode at D1 with closed mode shadow trees]
expected: FAIL
[Firing an event at D1 with relatedNode at B1a with open mode shadow trees]
expected: FAIL
[Firing an event at D1 with relatedNode at B1a with closed mode shadow trees]
expected: FAIL
[Firing an event at B1a with relatedNode at A1a with open mode shadow trees]
expected: FAIL
[Firing an event at B1a with relatedNode at A1a with closed mode shadow trees]
expected: FAIL
[Firing an event at A1a with relatedNode at B1a with open mode shadow trees]
expected: FAIL
[Firing an event at A1a with relatedNode at B1a with closed mode shadow trees]
expected: FAIL
[Firing an event at B1a with relatedNode at A1a (detached) with open mode shadow trees]
expected: FAIL
[Firing an event at B1a with relatedNode at A1a (detached) with closed mode shadow trees]
expected: FAIL
[Firing an event at A1a with relatedNode at B1a (detached) with open mode shadow trees]
expected: FAIL
[Firing an event at A1a with relatedNode at B1a (detached) with closed mode shadow trees]
expected: FAIL