ShadowRoot
Values
addEventListener
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. Read more on MDN
let addEventListener: ( DomTypes.shadowRoot, EventTypes.eventType, EventTypes.eventListener<'event>, ~options: EventTypes.addEventListenerOptions=?,) => unitParameters
DomTypes.shadowRoot EventTypes.eventType EventTypes.eventListener option< EventTypes.addEventListenerOptions >Return type
unitaddEventListenerWithCapture
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. Read more on MDN
let addEventListenerWithCapture: ( DomTypes.shadowRoot, EventTypes.eventType, EventTypes.eventListener<'event>,) => unitParameters
DomTypes.shadowRoot EventTypes.eventType EventTypes.eventListenerReturn type
unitappend
Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN
let append: (DomTypes.shadowRoot, DomTypes.node) => unitParameters
DomTypes.shadowRoot DomTypes.nodeReturn type
unitappend2
Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN
let append2: (DomTypes.shadowRoot, string) => unitParameters
DomTypes.shadowRoot stringReturn type
unitasDocumentFragment
let asDocumentFragment: DomTypes.shadowRoot => DomTypes.documentFragmentParameters
DomTypes.shadowRootReturn type
DomTypes.documentFragmentasEventTarget
let asEventTarget: DomTypes.shadowRoot => EventTypes.eventTargetParameters
DomTypes.shadowRootReturn type
EventTypes.eventTargetasNode
let asNode: DomTypes.shadowRoot => DomTypes.nodeParameters
DomTypes.shadowRootReturn type
DomTypes.nodecloneNode
Returns a copy of node. If deep is true, the copy also includes the node's descendants. Read more on MDN
let cloneNode: (DomTypes.shadowRoot, ~deep: bool=?) => DomTypes.shadowRootParameters
DomTypes.shadowRoot option< bool >Return type
DomTypes.shadowRootcompareDocumentPosition
Returns a bitmask indicating the position of other relative to node. Read more on MDN
let compareDocumentPosition: (DomTypes.shadowRoot, DomTypes.node) => intParameters
DomTypes.shadowRoot DomTypes.nodeReturn type
intcontains
Returns true if other is an inclusive descendant of node, and false otherwise. Read more on MDN
let contains: (DomTypes.shadowRoot, DomTypes.node) => boolParameters
DomTypes.shadowRoot DomTypes.nodeReturn type
booldispatchEvent
Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. Read more on MDN
let dispatchEvent: (DomTypes.shadowRoot, EventTypes.event) => boolParameters
DomTypes.shadowRoot EventTypes.eventReturn type
boolgetAnimations
let getAnimations: DomTypes.shadowRoot => array<DomTypes.animation>Parameters
DomTypes.shadowRootReturn type
array< DomTypes.animation >getElementById
Returns the first element within node's descendants whose ID is elementId. Read more on MDN
let getElementById: (DomTypes.shadowRoot, string) => null<DomTypes.element>Parameters
DomTypes.shadowRoot stringReturn type
Stdlib.null< DomTypes.element >getHTML
let getHTML: ( DomTypes.shadowRoot, ~options: DomTypes.getHTMLOptions=?,) => stringParameters
DomTypes.shadowRoot option< DomTypes.getHTMLOptions >Return type
stringgetRootNode
Returns node's root. Read more on MDN
let getRootNode: ( DomTypes.shadowRoot, ~options: DomTypes.getRootNodeOptions=?,) => DomTypes.nodeParameters
DomTypes.shadowRoot option< DomTypes.getRootNodeOptions >Return type
DomTypes.nodehasChildNodes
Returns whether node has children. Read more on MDN
let hasChildNodes: DomTypes.shadowRoot => boolParameters
DomTypes.shadowRootReturn type
boolinsertBefore
let insertBefore: (DomTypes.shadowRoot, 't, ~child: DomTypes.node) => 'tParameters
DomTypes.shadowRootReturn type
DomTypes.nodeisDefaultNamespace
let isDefaultNamespace: (DomTypes.shadowRoot, string) => boolParameters
DomTypes.shadowRoot stringReturn type
boolisEqualNode
Returns whether node and otherNode have the same properties. Read more on MDN
let isEqualNode: (DomTypes.shadowRoot, DomTypes.node) => boolParameters
DomTypes.shadowRoot DomTypes.nodeReturn type
boolisSameNode
let isSameNode: (DomTypes.shadowRoot, DomTypes.node) => boolParameters
DomTypes.shadowRoot DomTypes.nodeReturn type
boollookupNamespaceURI
let lookupNamespaceURI: (DomTypes.shadowRoot, string) => stringParameters
DomTypes.shadowRoot stringReturn type
stringlookupPrefix
let lookupPrefix: (DomTypes.shadowRoot, string) => stringParameters
DomTypes.shadowRoot stringReturn type
stringnormalize
Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. Read more on MDN
let normalize: DomTypes.shadowRoot => unitParameters
DomTypes.shadowRootReturn type
unitprepend
Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN
let prepend: (DomTypes.shadowRoot, DomTypes.node) => unitParameters
DomTypes.shadowRoot DomTypes.nodeReturn type
unitprepend2
Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN
let prepend2: (DomTypes.shadowRoot, string) => unitParameters
DomTypes.shadowRoot stringReturn type
unitquerySelector
Returns the first element that is a descendant of node that matches selectors. Read more on MDN
let querySelector: (DomTypes.shadowRoot, string) => Null.t<DomTypes.element>Parameters
DomTypes.shadowRoot stringReturn type
Stdlib.Null.t< DomTypes.element >querySelectorAll
Returns all element descendants of node that match selectors. Read more on MDN
let querySelectorAll: ( DomTypes.shadowRoot, string,) => DomTypes.nodeList<DomTypes.element>Parameters
DomTypes.shadowRoot stringReturn type
DomTypes.nodeList< DomTypes.element >removeEventListener
Removes the event listener in target's event listener list with the same type, callback, and options. Read more on MDN
let removeEventListener: ( DomTypes.shadowRoot, EventTypes.eventType, EventTypes.eventListener<'event>, ~options: EventTypes.eventListenerOptions=?,) => unitParameters
DomTypes.shadowRoot EventTypes.eventType EventTypes.eventListener option< EventTypes.eventListenerOptions >Return type
unitremoveEventListenerUseCapture
Removes the event listener in target's event listener list with the same type, callback, and options. Read more on MDN
let removeEventListenerUseCapture: ( DomTypes.shadowRoot, EventTypes.eventType, EventTypes.eventListener<'event>,) => unitParameters
DomTypes.shadowRoot EventTypes.eventType EventTypes.eventListenerReturn type
unitreplaceChild
let replaceChild: (DomTypes.shadowRoot, ~node: DomTypes.node, 't) => 'tParameters
DomTypes.shadowRootReturn type
DomTypes.nodereplaceChildren
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN
let replaceChildren: (DomTypes.shadowRoot, DomTypes.node) => unitParameters
DomTypes.shadowRoot DomTypes.nodeReturn type
unitreplaceChildren2
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN
let replaceChildren2: (DomTypes.shadowRoot, string) => unitParameters
DomTypes.shadowRoot stringReturn type
unitsetHTMLUnsafe
let setHTMLUnsafe: (DomTypes.shadowRoot, string) => unit