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

@ -83,7 +83,16 @@ interface Element : Node {
[CEReactions, Throws]
undefined insertAdjacentHTML(DOMString position, DOMString html);
[Throws, Pref="dom.shadowdom.enabled"] ShadowRoot attachShadow();
[Throws, Pref="dom.shadowdom.enabled"] ShadowRoot attachShadow(ShadowRootInit init);
readonly attribute ShadowRoot? shadowRoot;
};
dictionary ShadowRootInit {
required ShadowRootMode mode;
// boolean delegatesFocus = false;
// SlotAssignmentMode slotAssignment = "named";
// boolean clonable = false;
// boolean serializable = false;
};
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-element-interface

View file

@ -13,5 +13,6 @@ interface ShadowRoot : DocumentFragment {
};
enum ShadowRootMode { "open", "closed"};
// enum SlotAssignmentMode { "manual", "named" };
ShadowRoot includes DocumentOrShadowRoot;