Implement element.shadowRoot attribute (#34306)

* Implement Element.shadowRoot attribute

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

* Remove comments about shadowdom not being exposed for web content

This is obviously not the case anymore.

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 2024-11-21 01:22:42 +01:00 committed by GitHub
parent c5cf2621b6
commit 527e2d426d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 209 additions and 65 deletions

View file

@ -1,2 +1,3 @@
[transform-origin-in-shadow.html]
expected: ERROR
['transform-origin' on <svg> being direct descendant of shadow root]
expected: FAIL

View file

@ -64,9 +64,6 @@
[XPathResult interface: constant STRING_TYPE on interface prototype object]
expected: FAIL
[Element interface: attribute shadowRoot]
expected: FAIL
[XPathResult interface: document.evaluate("//*", document.body) must inherit property "ORDERED_NODE_ITERATOR_TYPE" with the proper type]
expected: FAIL
@ -91,9 +88,6 @@
[EventTarget interface: new AbortController().signal must inherit property "removeEventListener(DOMString, EventListener?, optional (EventListenerOptions or boolean))" with the proper type]
expected: FAIL
[Element interface: operation attachShadow(ShadowRootInit)]
expected: FAIL
[Document interface: xmlDoc must inherit property "createNSResolver(Node)" with the proper type]
expected: FAIL
@ -124,9 +118,6 @@
[XPathResult interface: constant UNORDERED_NODE_SNAPSHOT_TYPE on interface prototype object]
expected: FAIL
[Element interface: calling attachShadow(ShadowRootInit) on element with too few arguments must throw TypeError]
expected: FAIL
[XPathResult interface: constant ORDERED_NODE_SNAPSHOT_TYPE on interface object]
expected: FAIL
@ -511,9 +502,6 @@
[Element interface: operation append((Node or DOMString)...)]
expected: FAIL
[Element interface: element must inherit property "shadowRoot" with the proper type]
expected: FAIL
[XPathEvaluator interface: existence and properties of interface prototype object]
expected: FAIL

View file

@ -1,2 +1,2 @@
[dialog-focus-shadow-double-nested.html]
expected: ERROR
expected: CRASH

View file

@ -1,2 +1,150 @@
[dialog-focus-shadow.html]
expected: ERROR
[show: No autofocus, no delegatesFocus, no siblings]
expected: FAIL
[showModal: No autofocus, no delegatesFocus, no siblings]
expected: FAIL
[show: No autofocus, no delegatesFocus, sibling before]
expected: FAIL
[showModal: No autofocus, no delegatesFocus, sibling before]
expected: FAIL
[show: No autofocus, no delegatesFocus, sibling after]
expected: FAIL
[showModal: No autofocus, no delegatesFocus, sibling after]
expected: FAIL
[show: No autofocus, yes delegatesFocus, no siblings]
expected: FAIL
[showModal: No autofocus, yes delegatesFocus, no siblings]
expected: FAIL
[show: No autofocus, yes delegatesFocus, sibling before]
expected: FAIL
[showModal: No autofocus, yes delegatesFocus, sibling before]
expected: FAIL
[show: No autofocus, yes delegatesFocus, sibling after]
expected: FAIL
[showModal: No autofocus, yes delegatesFocus, sibling after]
expected: FAIL
[show: Autofocus before, no delegatesFocus]
expected: FAIL
[showModal: Autofocus before, no delegatesFocus]
expected: FAIL
[show: Autofocus before, yes delegatesFocus]
expected: FAIL
[showModal: Autofocus before, yes delegatesFocus]
expected: FAIL
[show: Autofocus after, no delegatesFocus]
expected: FAIL
[showModal: Autofocus after, no delegatesFocus]
expected: FAIL
[show: Autofocus after, yes delegatesFocus]
expected: FAIL
[showModal: Autofocus after, yes delegatesFocus]
expected: FAIL
[show: Autofocus on shadow host, yes delegatesFocus, no siblings]
expected: FAIL
[showModal: Autofocus on shadow host, yes delegatesFocus, no siblings]
expected: FAIL
[show: Autofocus on shadow host, yes delegatesFocus, sibling before]
expected: FAIL
[showModal: Autofocus on shadow host, yes delegatesFocus, sibling before]
expected: FAIL
[show: Autofocus on shadow host, yes delegatesFocus, sibling after]
expected: FAIL
[showModal: Autofocus on shadow host, yes delegatesFocus, sibling after]
expected: FAIL
[show: Autofocus on shadow host, no delegatesFocus, no siblings]
expected: FAIL
[showModal: Autofocus on shadow host, no delegatesFocus, no siblings]
expected: FAIL
[show: Autofocus on shadow host, no delegatesFocus, sibling before]
expected: FAIL
[showModal: Autofocus on shadow host, no delegatesFocus, sibling before]
expected: FAIL
[show: Autofocus on shadow host, no delegatesFocus, sibling after]
expected: FAIL
[showModal: Autofocus on shadow host, no delegatesFocus, sibling after]
expected: FAIL
[show: Autofocus inside shadow tree, yes delegatesFocus, no siblings]
expected: FAIL
[showModal: Autofocus inside shadow tree, yes delegatesFocus, no siblings]
expected: FAIL
[show: Autofocus inside shadow tree, yes delegatesFocus, sibling before]
expected: FAIL
[showModal: Autofocus inside shadow tree, yes delegatesFocus, sibling before]
expected: FAIL
[show: Autofocus inside shadow tree, yes delegatesFocus, sibling after]
expected: FAIL
[showModal: Autofocus inside shadow tree, yes delegatesFocus, sibling after]
expected: FAIL
[show: Autofocus inside shadow tree, no delegatesFocus, no siblings]
expected: FAIL
[showModal: Autofocus inside shadow tree, no delegatesFocus, no siblings]
expected: FAIL
[show: Autofocus inside shadow tree, no delegatesFocus, sibling before]
expected: FAIL
[showModal: Autofocus inside shadow tree, no delegatesFocus, sibling before]
expected: FAIL
[show: Autofocus inside shadow tree, no delegatesFocus, sibling after]
expected: FAIL
[showModal: Autofocus inside shadow tree, no delegatesFocus, sibling after]
expected: FAIL
[show: Two shadow trees, both delegatesFocus, first tree doesn't have autofocus element, second does]
expected: FAIL
[showModal: Two shadow trees, both delegatesFocus, first tree doesn't have autofocus element, second does]
expected: FAIL
[show: No autofocus, no delegatesFocus, slotted target]
expected: FAIL
[showModal: No autofocus, no delegatesFocus, slotted target]
expected: FAIL
[show: Shadowroot on child, no autofocus, no delegatesFocus]
expected: FAIL
[showModal: Shadowroot on child, no autofocus, no delegatesFocus]
expected: FAIL

View file

@ -1,6 +1,3 @@
[Element-interface-attachShadow.html]
[Element.attachShadow must throw a TypeError if mode is not "open" or "closed"]
expected: FAIL
[Element.attachShadow must throw a NotSupportedError if the context object already hosts a shadow tree]
expected: FAIL

View file

@ -1,9 +0,0 @@
[Element-interface-shadowRoot-attribute.html]
[shadowRoot must be defined on Element prototype]
expected: FAIL
[shadowRoot attribute must return the open shadow root associated with the element]
expected: FAIL
[shadowRoot attribute must return null if the shadow root attached to the element is closed]
expected: FAIL

View file

@ -4,6 +4,3 @@
[cloneNode on a shadow root in closed mode must throw a NotSupportedError]
expected: FAIL
[cloneNode on an element with an open shadow root should not clone its shadow root]
expected: FAIL

View file

@ -56,8 +56,5 @@
[Declarative Shadow DOM: template containing declarative shadow root and UA shadow root]
expected: FAIL
[Declarative Shadow DOM: declarative shadow roots are not supported by the template element]
expected: FAIL
[Declarative Shadow DOM: explicit test that exceptions are not thrown]
expected: FAIL

View file

@ -8,15 +8,9 @@
[:focus applies to host with delegatesFocus=true when an element in a nested shadow tree with delegatesFocus=true is focused]
expected: FAIL
[:focus should be removed from hosts with delegatesFocus=true when none of the elements in a nested shadow tree with delegatesFocus=true is focused]
expected: FAIL
[:focus applies to host with delegatesFocus=true when an element in a nested shadow tree with delegatesFocus=false is focused]
expected: FAIL
[:focus should be removed from hosts with delegatesFocus=true when none of the elements in a nested shadow tree with delegatesFocus=false is focused]
expected: FAIL
[:focus applies to host with delegatesFocus=false when the shadow root's descendant has focus]
expected: FAIL
@ -26,11 +20,5 @@
[:focus applies to host with delegatesFocus=false when an element in a nested shadow tree with delegatesFocus=true is focused]
expected: FAIL
[:focus should be removed from hosts with delegatesFocus=false when none of the elements in a nested shadow tree with delegatesFocus=true is focused]
expected: FAIL
[:focus applies to host with delegatesFocus=false when an element in a nested shadow tree with delegatesFocus=false is focused]
expected: FAIL
[:focus should be removed from hosts with delegatesFocus=false when none of the elements in a nested shadow tree with delegatesFocus=false is focused]
expected: FAIL

View file

@ -1,3 +0,0 @@
[test-006.html]
[A_10_02_01_06_T01]
expected: FAIL