ladybird/Libraries/LibWeb/DOM/ShadowRoot.idl
Andreas Kling f49335f210 LibWeb: Align declarative shadow root parsing
Teach the Rust parser to recognize declarative shadow root templates and
pass the parsed mode, slot assignment, clonable, serializable, and
focus-delegation flags to the C++ DOM host.

Expose shadowRootSlotAssignment reflection with the spec-defined named
missing and invalid value defaults, and extend the ShadowDOM text test
coverage for the reflected property and parser-created shadow roots.
2026-05-17 15:35:56 +02:00

24 lines
953 B
Text

// https://dom.spec.whatwg.org/#shadowroot
[Exposed=Window]
interface ShadowRoot : DocumentFragment {
readonly attribute ShadowRootMode mode;
readonly attribute boolean delegatesFocus;
readonly attribute SlotAssignmentMode slotAssignment;
readonly attribute boolean clonable;
readonly attribute boolean serializable;
readonly attribute Element host;
attribute EventHandler onslotchange;
// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsing-and-serialization
[CEReactions] undefined setHTMLUnsafe((TrustedHTML or Utf16DOMString) html);
DOMString getHTML(optional GetHTMLOptions options = {});
[CEReactions, LegacyNullToEmptyString] attribute (TrustedHTML or Utf16DOMString) innerHTML;
};
ShadowRoot includes DocumentOrShadowRoot;
enum ShadowRootMode { "open", "closed" };
[MissingValueDefault=named, InvalidValueDefault=named]
enum SlotAssignmentMode { "manual", "named" };