ShadowRoot class

The interface of the Shadow DOM API is the root node of a DOM subtree that is rendered separately from a document's main DOM tree. You can retrieve a reference to an element's shadow root using its Element.shadowRoot property, provided it was created using Element.attachShadow() with the mode option set to open.

EventTarget

Node

DocumentFragment

ShadowRoot

Implemented types
Implementers
Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

ShadowRoot()
factory

Properties

activeElement Element?

Available on DocumentOrShadowRoot, provided by the PropsDocumentOrShadowRoot extension

no setter
adoptedStyleSheets Iterable<CSSStyleSheet>

Available on DocumentOrShadowRoot, provided by the PropsDocumentOrShadowRoot extension

getter/setter pair
baseURI String

Available on Node, provided by the PropsNode extension

no setter
childElementCount int

Available on ParentNode, provided by the PropsParentNode extension

no setter
childNodes NodeList

Available on Node, provided by the PropsNode extension

no setter
children HTMLCollection

Available on ParentNode, provided by the PropsParentNode extension

no setter
delegatesFocus bool

Available on ShadowRoot, provided by the PropsShadowRoot extension

no setter
firstChild Node?

Available on Node, provided by the PropsNode extension

no setter
firstElementChild Element?

Available on ParentNode, provided by the PropsParentNode extension

no setter
fullscreenElement Element?

Available on DocumentOrShadowRoot, provided by the PropsDocumentOrShadowRoot extension

no setter
hashCode int
The hash code for this object.
no setterinherited
host Element

Available on ShadowRoot, provided by the PropsShadowRoot extension

no setter
innerHTML String

Available on InnerHTML, provided by the PropsInnerHTML extension

getter/setter pair
isConnected bool

Available on Node, provided by the PropsNode extension

no setter
lastChild Node?

Available on Node, provided by the PropsNode extension

no setter
lastElementChild Element?

Available on ParentNode, provided by the PropsParentNode extension

no setter
mode ShadowRootMode

Available on ShadowRoot, provided by the PropsShadowRoot extension

no setter
nextSibling Node?

Available on Node, provided by the PropsNode extension

no setter
nodeName String

Available on Node, provided by the PropsNode extension

no setter
nodeType int

Available on Node, provided by the PropsNode extension

no setter
nodeValue String?

Available on Node, provided by the PropsNode extension

getter/setter pair
onslotchange EventHandlerNonNull<Event>?

Available on ShadowRoot, provided by the PropsShadowRoot extension

getter/setter pair
ownerDocument Document?

Available on Node, provided by the PropsNode extension

no setter
parentElement Element?

Available on Node, provided by the PropsNode extension

no setter
parentNode Node?

Available on Node, provided by the PropsNode extension

no setter
pictureInPictureElement Element?

Available on DocumentOrShadowRoot, provided by the PropsDocumentOrShadowRoot extension

no setter
pointerLockElement Element?

Available on DocumentOrShadowRoot, provided by the PropsDocumentOrShadowRoot extension

no setter
previousSibling Node?

Available on Node, provided by the PropsNode extension

no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
slotAssignment SlotAssignmentMode

Available on ShadowRoot, provided by the PropsShadowRoot extension

no setter
styleSheets StyleSheetList

Available on DocumentOrShadowRoot, provided by the PropsDocumentOrShadowRoot extension

no setter
textContent String?

Available on Node, provided by the PropsNode extension

getter/setter pair

Methods

addEventListener(String type, EventListener? callback, [dynamic options]) → void

Available on EventTarget, provided by the PropsEventTarget extension

append([dynamic nodes1, dynamic nodes2, dynamic nodes3]) → void

Available on ParentNode, provided by the PropsParentNode extension

appendChild(Node node) Node

Available on Node, provided by the PropsNode extension

cloneNode([bool? deep = false]) Node

Available on Node, provided by the PropsNode extension

compareDocumentPosition(Node other) int

Available on Node, provided by the PropsNode extension

contains(Node? other) bool

Available on Node, provided by the PropsNode extension

dispatchEvent(Event event) bool

Available on EventTarget, provided by the PropsEventTarget extension

getAnimations() Iterable<Animation>

Available on DocumentOrShadowRoot, provided by the PropsDocumentOrShadowRoot extension

getElementById(String elementId) Element?

Available on NonElementParentNode, provided by the PropsNonElementParentNode extension

getRootNode([GetRootNodeOptions? options]) Node

Available on Node, provided by the PropsNode extension

hasChildNodes() bool

Available on Node, provided by the PropsNode extension

insertBefore(Node node, Node? child) Node

Available on Node, provided by the PropsNode extension

isDefaultNamespace(String? namespace) bool

Available on Node, provided by the PropsNode extension

isEqualNode(Node? otherNode) bool

Available on Node, provided by the PropsNode extension

isSameNode(Node? otherNode) bool

Available on Node, provided by the PropsNode extension

lookupNamespaceURI(String? prefix) String?

Available on Node, provided by the PropsNode extension

lookupPrefix(String? namespace) String?

Available on Node, provided by the PropsNode extension

normalize() → void

Available on Node, provided by the PropsNode extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepend([dynamic nodes1, dynamic nodes2, dynamic nodes3]) → void

Available on ParentNode, provided by the PropsParentNode extension

querySelector(String selectors) Element?

Available on ParentNode, provided by the PropsParentNode extension

querySelectorAll(String selectors) NodeList

Available on ParentNode, provided by the PropsParentNode extension

removeChild(Node child) Node

Available on Node, provided by the PropsNode extension

removeEventListener(String type, EventListener? callback, [dynamic options]) → void

Available on EventTarget, provided by the PropsEventTarget extension

replaceChild(Node node, Node child) Node

Available on Node, provided by the PropsNode extension

replaceChildren([dynamic nodes1, dynamic nodes2, dynamic nodes3]) → void

Available on ParentNode, provided by the PropsParentNode extension

toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited