Comment
Types
getRootNodeOptions
type getRootNodeOptions = {mutable composed?: bool}Record fields
composed
t
Textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view. See Comment on MDN
type t = private { nodeType: int, nodeName: string, baseURI: string, isConnected: bool, ownerDocument: Null.t<WebAPI.DOM.document>, parentNode: Null.t<WebAPI.DOMTree.node>, parentElement: Null.t<WebAPI.DOMTree.htmlElement>, childNodes: WebAPI.DOM.nodeList<WebAPI.DOMTree.node>, firstChild: Null.t<WebAPI.DOMTree.node>, lastChild: Null.t<WebAPI.DOMTree.node>, previousSibling: Null.t<WebAPI.DOMTree.node>, nextSibling: Null.t<WebAPI.DOMTree.node>, mutable nodeValue: Null.t<string>, mutable textContent: Null.t<string>, mutable data: string, length: int, previousElementSibling: Null.t<WebAPI.DOMTree.element>, nextElementSibling: Null.t<WebAPI.DOMTree.element>,}Record fields
ownerDocument
Returns the node document. Returns null for documents. Read more on MDN
previousElementSibling
Returns the first preceding sibling that is an element, and null otherwise. Read more on MDN
nextElementSibling
Returns the first following sibling that is an element, and null otherwise. Read more on MDN
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: ( t, WebAPI.EventType.t, WebAPI.DOM.EventListener.t<'event>, ~options: WebAPI.DOM.EventListener.addEventListenerOptions=?,) => unitParameters
tWebAPI.EventType.tWebAPI.DOM.EventListener.toption<WebAPI.DOM.EventListener.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: ( t, WebAPI.EventType.t, WebAPI.DOM.EventListener.t<'event>,) => unitafter
Inserts nodes just after 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 after: (t, WebAPI.DOMTree.node) => unitafter2
Inserts nodes just after 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 after2: (t, string) => unitasCharacterData
let asCharacterData: t => \"CharacterData-WebAPI".tasEventTarget
let asEventTarget: t => WebAPI.DOM.eventTargetbefore
Inserts nodes just before 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 before: (t, WebAPI.DOMTree.node) => unitbefore2
Inserts nodes just before 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 before2: (t, string) => unitcloneNode
Returns a copy of node. If deep is true, the copy also includes the node's descendants. Read more on MDN
let cloneNode: (t, ~deep: bool=?) => tcompareDocumentPosition
Returns a bitmask indicating the position of other relative to node. Read more on MDN
let compareDocumentPosition: (t, WebAPI.DOMTree.node) => intcontains
Returns true if other is an inclusive descendant of node, and false otherwise. Read more on MDN
let contains: (t, WebAPI.DOMTree.node) => booldeleteData
let deleteData: (t, ~offset: int, ~count: int) => unitdispatchEvent
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: (t, WebAPI.DOM.event) => boolgetRootNode
Returns node's root. Read more on MDN
let getRootNode: (t, ~options: getRootNodeOptions=?) => WebAPI.DOMTree.nodeinsertBefore
let insertBefore: (t, 't, ~child: WebAPI.DOMTree.node) => 'tinsertData
let insertData: (t, ~offset: int, ~data: string) => unitisDefaultNamespace
let isDefaultNamespace: (t, string) => boolisEqualNode
Returns whether node and otherNode have the same properties. Read more on MDN
let isEqualNode: (t, WebAPI.DOMTree.node) => boolisSameNode
let isSameNode: (t, WebAPI.DOMTree.node) => boollookupNamespaceURI
let lookupNamespaceURI: (t, string) => Null.t<string>lookupPrefix
let lookupPrefix: (t, string) => Null.t<string>normalize
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: t => unitremoveEventListener
Removes the event listener in target's event listener list with the same type, callback, and options. Read more on MDN
let removeEventListener: ( t, WebAPI.EventType.t, WebAPI.DOM.EventListener.t<'event>, ~options: WebAPI.DOM.EventListener.options=?,) => unitParameters
tWebAPI.EventType.tWebAPI.DOM.EventListener.toption<WebAPI.DOM.EventListener.options>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: ( t, WebAPI.EventType.t, WebAPI.DOM.EventListener.t<'event>,) => unitreplaceChild
let replaceChild: (t, ~node: WebAPI.DOMTree.node, 't) => 'treplaceData
let replaceData: (t, ~offset: int, ~count: int, ~data: string) => unitreplaceWith
Replaces 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 replaceWith: (t, WebAPI.DOMTree.node) => unitreplaceWith2
Replaces 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 replaceWith2: (t, string) => unitsubstringData
let substringData: (t, ~offset: int, ~count: int) => string