HTMLCanvasElement
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.htmlCanvasElement, EventTypes.eventType, EventTypes.eventListener<'event>, ~options: EventTypes.addEventListenerOptions=?,) => unitParameters
DomTypes.htmlCanvasElement 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.htmlCanvasElement, EventTypes.eventType, EventTypes.eventListener<'event>,) => unitParameters
DomTypes.htmlCanvasElement EventTypes.eventType EventTypes.eventListenerReturn type
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: (DomTypes.htmlCanvasElement, DomTypes.node) => unitParameters
DomTypes.htmlCanvasElement DomTypes.nodeReturn type
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: (DomTypes.htmlCanvasElement, string) => unitParameters
DomTypes.htmlCanvasElement stringReturn type
unitanimate
let animate: ( DomTypes.htmlCanvasElement, ~keyframes: unknown, ~options: float=?,) => DomTypes.animationParameters
DomTypes.htmlCanvasElement unknown option< float >Return type
DomTypes.animationanimate2
let animate2: ( DomTypes.htmlCanvasElement, ~keyframes: unknown, ~options: DomTypes.keyframeAnimationOptions=?,) => DomTypes.animationParameters
DomTypes.htmlCanvasElement unknown option< DomTypes.keyframeAnimationOptions >Return type
DomTypes.animationappend
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.htmlCanvasElement, DomTypes.node) => unitParameters
DomTypes.htmlCanvasElement 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.htmlCanvasElement, string) => unitParameters
DomTypes.htmlCanvasElement stringReturn type
unitasElement
let asElement: DomTypes.htmlCanvasElement => DomTypes.elementParameters
DomTypes.htmlCanvasElementReturn type
DomTypes.elementasEventTarget
let asEventTarget: DomTypes.htmlCanvasElement => EventTypes.eventTargetParameters
DomTypes.htmlCanvasElementReturn type
EventTypes.eventTargetasHTMLElement
let asHTMLElement: DomTypes.htmlCanvasElement => HTMLElement.tParameters
DomTypes.htmlCanvasElementReturn type
HTMLElement.tasNode
let asNode: DomTypes.htmlCanvasElement => DomTypes.nodeParameters
DomTypes.htmlCanvasElementReturn type
DomTypes.nodeattachInternals
let attachInternals: DomTypes.htmlCanvasElement => DomTypes.elementInternalsParameters
DomTypes.htmlCanvasElementReturn type
DomTypes.elementInternalsattachShadow
Creates a shadow root for element and returns it. Read more on MDN
let attachShadow: ( DomTypes.htmlCanvasElement, DomTypes.shadowRootInit,) => DomTypes.shadowRootParameters
DomTypes.htmlCanvasElement DomTypes.shadowRootInitReturn type
DomTypes.shadowRootbefore
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: (DomTypes.htmlCanvasElement, DomTypes.node) => unitParameters
DomTypes.htmlCanvasElement DomTypes.nodeReturn type
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: (DomTypes.htmlCanvasElement, string) => unitParameters
DomTypes.htmlCanvasElement stringReturn type
unitblur
let blur: DomTypes.htmlCanvasElement => unitParameters
DomTypes.htmlCanvasElementReturn type
unitcaptureStream
let captureStream: ( DomTypes.htmlCanvasElement, ~frameRequestRate: float=?,) => MediaCaptureAndStreamsTypes.mediaStreamParameters
DomTypes.htmlCanvasElement option< float >Return type
MediaCaptureAndStreamsTypes.mediaStreamcheckVisibility
let checkVisibility: ( DomTypes.htmlCanvasElement, ~options: DomTypes.checkVisibilityOptions=?,) => boolParameters
DomTypes.htmlCanvasElement option< DomTypes.checkVisibilityOptions >Return type
boolclick
let click: DomTypes.htmlCanvasElement => unitParameters
DomTypes.htmlCanvasElementReturn type
unitcloneNode
Returns a copy of node. If deep is true, the copy also includes the node's descendants. Read more on MDN
let cloneNode: ( DomTypes.htmlCanvasElement, ~deep: bool=?,) => DomTypes.htmlCanvasElementParameters
DomTypes.htmlCanvasElement option< bool >Return type
DomTypes.htmlCanvasElementclosest
Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. Read more on MDN
let closest: (DomTypes.htmlCanvasElement, string) => 'eParameters
DomTypes.htmlCanvasElementReturn type
stringcompareDocumentPosition
Returns a bitmask indicating the position of other relative to node. Read more on MDN
let compareDocumentPosition: (DomTypes.htmlCanvasElement, DomTypes.node) => intParameters
DomTypes.htmlCanvasElement DomTypes.nodeReturn type
intcomputedStyleMap
let computedStyleMap: DomTypes.htmlCanvasElement => DomTypes.stylePropertyMapReadOnlyParameters
DomTypes.htmlCanvasElementReturn type
DomTypes.stylePropertyMapReadOnlycontains
Returns true if other is an inclusive descendant of node, and false otherwise. Read more on MDN
let contains: (DomTypes.htmlCanvasElement, DomTypes.node) => boolParameters
DomTypes.htmlCanvasElement 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.htmlCanvasElement, EventTypes.event) => boolParameters
DomTypes.htmlCanvasElement EventTypes.eventReturn type
boolfocus
let focus: ( DomTypes.htmlCanvasElement, ~options: DomTypes.focusOptions=?,) => unitParameters
DomTypes.htmlCanvasElement option< DomTypes.focusOptions >Return type
unitgetAnimations
let getAnimations: ( DomTypes.htmlCanvasElement, ~options: DomTypes.getAnimationsOptions=?,) => array<DomTypes.animation>Parameters
DomTypes.htmlCanvasElement option< DomTypes.getAnimationsOptions >Return type
array< DomTypes.animation >getAttribute
Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. Read more on MDN
let getAttribute: (DomTypes.htmlCanvasElement, string) => null<string>Parameters
DomTypes.htmlCanvasElement stringReturn type
Stdlib.null< string >getAttributeNames
Returns the qualified names of all element's attributes. Can contain duplicates. Read more on MDN
let getAttributeNames: DomTypes.htmlCanvasElement => array<string>Parameters
DomTypes.htmlCanvasElementReturn type
array< string >getAttributeNode
let getAttributeNode: (DomTypes.htmlCanvasElement, string) => DomTypes.attrParameters
DomTypes.htmlCanvasElement stringReturn type
DomTypes.attrgetAttributeNodeNS
let getAttributeNodeNS: ( DomTypes.htmlCanvasElement, ~namespace: string, ~localName: string,) => DomTypes.attrParameters
DomTypes.htmlCanvasElement string stringReturn type
DomTypes.attrgetAttributeNS
Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. Read more on MDN
let getAttributeNS: ( DomTypes.htmlCanvasElement, ~namespace: string, ~localName: string,) => stringParameters
DomTypes.htmlCanvasElement string stringReturn type
stringgetBoundingClientRect
let getBoundingClientRect: DomTypes.htmlCanvasElement => DomTypes.domRectParameters
DomTypes.htmlCanvasElementReturn type
DomTypes.domRectgetClientRects
let getClientRects: DomTypes.htmlCanvasElement => DomTypes.domRectListParameters
DomTypes.htmlCanvasElementReturn type
DomTypes.domRectListgetContext2D
Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. Creates a CanvasRenderingContext2D object representing a two-dimensional rendering context.
let getContext2D: ( DomTypes.htmlCanvasElement, ~options: CanvasTypes.canvasRenderingContext2DSettings=?,) => DomTypes.canvasRenderingContext2DParameters
DomTypes.htmlCanvasElement option< CanvasTypes.canvasRenderingContext2DSettings >Return type
DomTypes.canvasRenderingContext2DgetContextBitmapRenderer
Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); Read more on MDN
let getContextBitmapRenderer: ( DomTypes.htmlCanvasElement, ~options: CanvasTypes.imageBitmapRenderingContextSettings=?,) => CanvasTypes.imageBitmapRenderingContextParameters
DomTypes.htmlCanvasElement option< CanvasTypes.imageBitmapRenderingContextSettings >Return type
CanvasTypes.imageBitmapRenderingContextgetContextWebGL
Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); Read more on MDN
let getContextWebGL: ( DomTypes.htmlCanvasElement, ~options: CanvasTypes.webGLContextAttributes=?,) => CanvasTypes.webGLRenderingContextParameters
DomTypes.htmlCanvasElement option< CanvasTypes.webGLContextAttributes >Return type
CanvasTypes.webGLRenderingContextgetContextWebGL2
Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); Read more on MDN
let getContextWebGL2: ( DomTypes.htmlCanvasElement, ~options: CanvasTypes.webGLContextAttributes=?,) => CanvasTypes.webGL2RenderingContextParameters
DomTypes.htmlCanvasElement option< CanvasTypes.webGLContextAttributes >Return type
CanvasTypes.webGL2RenderingContextgetElementsByClassName
Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes. Read more on MDN
let getElementsByClassName: ( DomTypes.htmlCanvasElement, string,) => DomTypes.htmlCollection<DomTypes.element>Parameters
DomTypes.htmlCanvasElement stringReturn type
DomTypes.htmlCollection< DomTypes.element >getElementsByTagName
let getElementsByTagName: ( DomTypes.htmlCanvasElement, string,) => DomTypes.htmlCollection<DomTypes.element>Parameters
DomTypes.htmlCanvasElement stringReturn type
DomTypes.htmlCollection< DomTypes.element >getElementsByTagNameNS
let getElementsByTagNameNS: ( DomTypes.element, ~namespace: string, ~localName: string,) => DomTypes.htmlCollection<DomTypes.element>Parameters
DomTypes.element string stringReturn type
DomTypes.htmlCollection< DomTypes.element >getHTML
let getHTML: ( DomTypes.htmlCanvasElement, ~options: DomTypes.getHTMLOptions=?,) => stringParameters
DomTypes.htmlCanvasElement option< DomTypes.getHTMLOptions >Return type
stringgetRootNode
Returns node's root. Read more on MDN
let getRootNode: ( DomTypes.htmlCanvasElement, ~options: DomTypes.getRootNodeOptions=?,) => DomTypes.nodeParameters
DomTypes.htmlCanvasElement option< DomTypes.getRootNodeOptions >Return type
DomTypes.nodehasAttribute
Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. Read more on MDN
let hasAttribute: (DomTypes.htmlCanvasElement, string) => boolParameters
DomTypes.htmlCanvasElement stringReturn type
boolhasAttributeNS
Returns true if element has an attribute whose namespace is namespace and local name is localName. Read more on MDN
let hasAttributeNS: ( DomTypes.htmlCanvasElement, ~namespace: string, ~localName: string,) => boolParameters
DomTypes.htmlCanvasElement string stringReturn type
boolhasAttributes
Returns true if element has attributes, and false otherwise. Read more on MDN
let hasAttributes: DomTypes.htmlCanvasElement => boolParameters
DomTypes.htmlCanvasElementReturn type
boolhasChildNodes
Returns whether node has children. Read more on MDN
let hasChildNodes: DomTypes.htmlCanvasElement => boolParameters
DomTypes.htmlCanvasElementReturn type
boolhasPointerCapture
let hasPointerCapture: (DomTypes.htmlCanvasElement, int) => boolParameters
DomTypes.htmlCanvasElement intReturn type
boolhidePopover
let hidePopover: DomTypes.htmlCanvasElement => unitParameters
DomTypes.htmlCanvasElementReturn type
unitinsertAdjacentElement
let insertAdjacentElement: ( DomTypes.htmlCanvasElement, ~where: DomTypes.insertPosition, ~element: DomTypes.element,) => DomTypes.elementParameters
DomTypes.htmlCanvasElement DomTypes.insertPosition DomTypes.elementReturn type
DomTypes.elementinsertAdjacentHTML
let insertAdjacentHTML: ( DomTypes.htmlCanvasElement, ~position: DomTypes.insertPosition, ~string: string,) => unitParameters
DomTypes.htmlCanvasElement DomTypes.insertPosition stringReturn type
unitinsertAdjacentText
let insertAdjacentText: ( DomTypes.htmlCanvasElement, ~where: DomTypes.insertPosition, ~data: string,) => unitParameters
DomTypes.htmlCanvasElement DomTypes.insertPosition stringReturn type
unitinsertBefore
let insertBefore: ( DomTypes.htmlCanvasElement, 't, ~child: DomTypes.node,) => 'tParameters
DomTypes.htmlCanvasElementReturn type
DomTypes.nodeisDefaultNamespace
let isDefaultNamespace: (DomTypes.htmlCanvasElement, string) => boolParameters
DomTypes.htmlCanvasElement stringReturn type
boolisEqualNode
Returns whether node and otherNode have the same properties. Read more on MDN
let isEqualNode: (DomTypes.htmlCanvasElement, DomTypes.node) => boolParameters
DomTypes.htmlCanvasElement DomTypes.nodeReturn type
boolisSameNode
let isSameNode: (DomTypes.htmlCanvasElement, DomTypes.node) => boolParameters
DomTypes.htmlCanvasElement DomTypes.nodeReturn type
boollookupNamespaceURI
let lookupNamespaceURI: (DomTypes.htmlCanvasElement, string) => stringParameters
DomTypes.htmlCanvasElement stringReturn type
stringlookupPrefix
let lookupPrefix: (DomTypes.htmlCanvasElement, string) => stringParameters
DomTypes.htmlCanvasElement stringReturn type
stringmatches
Returns true if matching selectors against element's root yields element, and false otherwise. Read more on MDN
let matches: (DomTypes.htmlCanvasElement, string) => boolParameters
DomTypes.htmlCanvasElement stringReturn type
boolnormalize
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.htmlCanvasElement => unitParameters
DomTypes.htmlCanvasElementReturn 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.htmlCanvasElement, DomTypes.node) => unitParameters
DomTypes.htmlCanvasElement 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.htmlCanvasElement, string) => unitParameters
DomTypes.htmlCanvasElement stringReturn type
unitquerySelector
Returns the first element that is a descendant of node that matches selectors. Read more on MDN
let querySelector: ( DomTypes.htmlCanvasElement, string,) => Null.t<DomTypes.element>Parameters
DomTypes.htmlCanvasElement stringReturn type
Stdlib.Null.t< DomTypes.element >querySelectorAll
Returns all element descendants of node that match selectors. Read more on MDN
let querySelectorAll: ( DomTypes.htmlCanvasElement, string,) => DomTypes.nodeList<DomTypes.element>Parameters
DomTypes.htmlCanvasElement stringReturn type
DomTypes.nodeList< DomTypes.element >releasePointerCapture
let releasePointerCapture: (DomTypes.htmlCanvasElement, int) => unitParameters
DomTypes.htmlCanvasElement intReturn type
unitremove
Removes node. Read more on MDN
let remove: DomTypes.htmlCanvasElement => unitParameters
DomTypes.htmlCanvasElementReturn type
unitremoveAttribute
Removes element's first attribute whose qualified name is qualifiedName. Read more on MDN
let removeAttribute: (DomTypes.htmlCanvasElement, string) => unitParameters
DomTypes.htmlCanvasElement stringReturn type
unitremoveAttributeNode
let removeAttributeNode: (DomTypes.htmlCanvasElement, DomTypes.attr) => DomTypes.attrParameters
DomTypes.htmlCanvasElement DomTypes.attrReturn type
DomTypes.attrremoveAttributeNS
Removes element's attribute whose namespace is namespace and local name is localName. Read more on MDN
let removeAttributeNS: ( DomTypes.htmlCanvasElement, ~namespace: string, ~localName: string,) => unitParameters
DomTypes.htmlCanvasElement string stringReturn type
unitremoveEventListener
Removes the event listener in target's event listener list with the same type, callback, and options. Read more on MDN
let removeEventListener: ( DomTypes.htmlCanvasElement, EventTypes.eventType, EventTypes.eventListener<'event>, ~options: EventTypes.eventListenerOptions=?,) => unitParameters
DomTypes.htmlCanvasElement 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.htmlCanvasElement, EventTypes.eventType, EventTypes.eventListener<'event>,) => unitParameters
DomTypes.htmlCanvasElement EventTypes.eventType EventTypes.eventListenerReturn type
unitreplaceChild
let replaceChild: (DomTypes.htmlCanvasElement, ~node: DomTypes.node, 't) => 'tParameters
DomTypes.htmlCanvasElementReturn 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.htmlCanvasElement, DomTypes.node) => unitParameters
DomTypes.htmlCanvasElement 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.htmlCanvasElement, string) => unitParameters
DomTypes.htmlCanvasElement stringReturn type
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: (DomTypes.htmlCanvasElement, DomTypes.node) => unitParameters
DomTypes.htmlCanvasElement DomTypes.nodeReturn type
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: (DomTypes.htmlCanvasElement, string) => unitParameters
DomTypes.htmlCanvasElement stringReturn type
unitrequestFullscreen
Displays element fullscreen and resolves promise when done.
When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to "show", navigation simplicity is preferred over screen space, and if set to "hide", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value "auto" indicates no application preference. Read more on MDN
let requestFullscreen: ( DomTypes.htmlCanvasElement, ~options: DomTypes.fullscreenOptions=?,) => promise<unit>Parameters
DomTypes.htmlCanvasElement option< DomTypes.fullscreenOptions >Return type
promise< unit >requestPointerLock
let requestPointerLock: ( DomTypes.htmlCanvasElement, ~options: DomTypes.pointerLockOptions=?,) => promise<unit>Parameters
DomTypes.htmlCanvasElement option< DomTypes.pointerLockOptions >Return type
promise< unit >scroll
let scroll: ( DomTypes.htmlCanvasElement, ~options: DomTypes.scrollToOptions=?,) => unitParameters
DomTypes.htmlCanvasElement option< DomTypes.scrollToOptions >Return type
unitscroll2
let scroll2: (DomTypes.htmlCanvasElement, ~x: float, ~y: float) => unitParameters
DomTypes.htmlCanvasElement float floatReturn type
unitscrollBy
let scrollBy: ( DomTypes.htmlCanvasElement, ~options: DomTypes.scrollToOptions=?,) => unitParameters
DomTypes.htmlCanvasElement option< DomTypes.scrollToOptions >Return type
unitscrollBy2
let scrollBy2: (DomTypes.htmlCanvasElement, ~x: float, ~y: float) => unitParameters
DomTypes.htmlCanvasElement float floatReturn type
unitscrollIntoView
scrollIntoView()
Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
element->Element.scrollIntoView()
let scrollIntoView: DomTypes.htmlCanvasElement => unitParameters
DomTypes.htmlCanvasElementReturn type
unitscrollIntoViewAlignToTop
scrollIntoView(true)
Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
element->Element.scrollIntoView_alignToTop()
let scrollIntoViewAlignToTop: DomTypes.htmlCanvasElement => unitParameters
DomTypes.htmlCanvasElementReturn type
unitscrollIntoViewWithOptions
scrollIntoView({ behavior: "smooth" })
Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
element->Element.scrollIntoViewWithOptions({ behavior: DOMAPI.Smooth })
let scrollIntoViewWithOptions: ( DomTypes.htmlCanvasElement, DomTypes.scrollIntoViewOptions,) => unitParameters
DomTypes.htmlCanvasElement DomTypes.scrollIntoViewOptionsReturn type
unitscrollTo
let scrollTo: ( DomTypes.htmlCanvasElement, ~options: DomTypes.scrollToOptions=?,) => unitParameters
DomTypes.htmlCanvasElement option< DomTypes.scrollToOptions >Return type
unitscrollTo2
let scrollTo2: (DomTypes.htmlCanvasElement, ~x: float, ~y: float) => unitParameters
DomTypes.htmlCanvasElement float floatReturn type
unitsetAttribute
Sets the value of element's first attribute whose qualified name is qualifiedName to value. Read more on MDN
let setAttribute: ( DomTypes.htmlCanvasElement, ~qualifiedName: string, ~value: string,) => unitParameters
DomTypes.htmlCanvasElement string stringReturn type
unitsetAttributeNode
let setAttributeNode: (DomTypes.htmlCanvasElement, DomTypes.attr) => DomTypes.attrParameters
DomTypes.htmlCanvasElement DomTypes.attrReturn type
DomTypes.attrsetAttributeNodeNS
let setAttributeNodeNS: (DomTypes.htmlCanvasElement, DomTypes.attr) => DomTypes.attrParameters
DomTypes.htmlCanvasElement DomTypes.attrReturn type
DomTypes.attrsetAttributeNS
Sets the value of element's attribute whose namespace is namespace and local name is localName to value. Read more on MDN
let setAttributeNS: ( DomTypes.element, ~namespace: string, ~qualifiedName: string, ~value: string,) => unitParameters
DomTypes.element string string stringReturn type
unitsetHTMLUnsafe
let setHTMLUnsafe: (DomTypes.htmlCanvasElement, string) => unitParameters
DomTypes.htmlCanvasElement stringReturn type
unitsetPointerCapture
let setPointerCapture: (DomTypes.htmlCanvasElement, int) => unitParameters
DomTypes.htmlCanvasElement intReturn type
unitshowPopover
let showPopover: DomTypes.htmlCanvasElement => unitParameters
DomTypes.htmlCanvasElementReturn type
unittoBlob
let toBlob: ( DomTypes.htmlCanvasElement, ~callback: FileTypes.blob => unit, ~type_: string=?, ~quality: JSON.t=?,) => unitParameters
DomTypes.htmlCanvasElement FileTypes.blob unit option< string > option< Stdlib.JSON.t >Return type
unittoDataURL
Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. Read more on MDN
let toDataURL: ( DomTypes.htmlCanvasElement, ~type_: string=?, ~quality: JSON.t=?,) => stringParameters
DomTypes.htmlCanvasElement option< string > option< Stdlib.JSON.t >Return type
stringtoggleAttribute
If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.
Returns true if qualifiedName is now present, and false otherwise. Read more on MDN
let toggleAttribute: ( DomTypes.htmlCanvasElement, ~qualifiedName: string, ~force: bool=?,) => boolParameters
DomTypes.htmlCanvasElement string option< bool >Return type
booltogglePopover
let togglePopover: (DomTypes.htmlCanvasElement, ~force: bool=?) => boolParameters
DomTypes.htmlCanvasElement option< bool >Return type
booltransferControlToOffscreen
let transferControlToOffscreen: DomTypes.htmlCanvasElement => CanvasTypes.offscreenCanvas