![]() The Node.getRootNode() method returns the context object's root, which optionally includes the shadow root if it is available.The Element.shadowRoot property returns the shadow root attached to the specified element, or null if there is no shadow root attached.Īdditions to the Node interface relevant to shadow DOM:.The Element.attachShadow() method attaches a shadow DOM tree to the specified element.Element extensionsĮxtensions to the Element interface related to shadow DOM: Represents the root node of a shadow DOM subtree. ::part: Represents any element within a shadow tree that has a matching part attribute.Pseudo-elements relating specifically to custom elements: :host-context(): Selects the shadow host of the shadow DOM containing the CSS it is used inside (so you can select a custom element from inside its shadow DOM) - but only if the selector given as the function's parameter matches the shadow host's ancestor(s) in the place it sits inside the DOM hierarchy.:host(): Selects the shadow host of the shadow DOM containing the CSS it is used inside (so you can select a custom element from inside its shadow DOM) - but only if the selector given as the function's parameter matches the shadow host.:host: Selects the shadow host of the shadow DOM containing the CSS it is used inside.:defined: Matches any element that is defined, including built in elements and custom elements defined with fine().Pseudo-classes relating specifically to custom elements: The "is" option of the Document.createElement() method: Allows you to create an instance of a standard HTML element that behaves like a given registered custom built-in element.The is global HTML attribute: Allows you to specify that a standard HTML element should behave like a registered custom built-in element.attributeChangedCallback: Invoked when one of the custom element's attributes is added, removed, or changed.Įxtensions for creating custom built-in elements.adoptedCallback: Invoked when the custom element is moved to a new document.disconnectedCallback: Invoked when the custom element is disconnected from the document's DOM.connectedCallback: Invoked when the custom element is first connected to the document's DOM. ![]() ![]() Special callback functions defined inside the custom element's class definition, which affect its behavior: Returns a reference to the CustomElementRegistry object.
0 Comments
Leave a Reply. |