Bug 1404842 - Implement Element.attachShadow and Element.slot

Tag #1375
This commit is contained in:
Matt A. Tobin 2020-04-17 07:04:42 -04:00 committed by Roy Tam
commit 67c4d022dc
48 changed files with 134 additions and 818 deletions

View file

@ -228,16 +228,28 @@ partial interface Element {
NodeList querySelectorAll(DOMString selectors);
};
// http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-element-interface
// https://dom.spec.whatwg.org/#dictdef-shadowrootinit
dictionary ShadowRootInit {
required ShadowRootMode mode;
};
// https://dom.spec.whatwg.org/#element
partial interface Element {
[Throws,Func="nsDocument::IsWebComponentsEnabled"]
ShadowRoot createShadowRoot();
[Func="nsDocument::IsWebComponentsEnabled"]
NodeList getDestinationInsertionPoints();
// Shadow DOM v1
[Throws, Pref="nsDocument::IsWebComponentsEnabled"]
ShadowRoot attachShadow(ShadowRootInit shadowRootInitDict);
[Func="nsDocument::IsWebComponentsEnabled"]
readonly attribute ShadowRoot? shadowRoot;
[Pref="nsDocument::IsWebComponentsEnabled"]
readonly attribute HTMLSlotElement? assignedSlot;
[CEReactions, Unscopable, SetterThrows, Pref="nsDocument::IsWebComponentsEnabled"]
attribute DOMString slot;
// [deprecated] Shadow DOM v0
[Throws, Pref="nsDocument::IsWebComponentsEnabled"]
ShadowRoot createShadowRoot();
[Pref="nsDocument::IsWebComponentsEnabled"]
NodeList getDestinationInsertionPoints();
};
Element implements ChildNode;