pub struct CanvasElement(_);
The HTML <canvas>
element provides an empty graphic zone on which specific JavaScript APIs
can draw (such as Canvas 2D or WebGL).
(JavaScript docs)
Returns a positive integer reflecting the height HTML attribute of the
(JavaScript docs)
Sets a positive integer reflecting the height HTML attribute of the
(JavaScript docs)
Returns a positive integer reflecting the width HTML attribute of the
(JavaScript docs)
Sets a positive integer reflecting the width HTML attribute of the
(JavaScript docs)
Returns a drawing context on the canvas, or None if the context identifier is not supported.
(JavaScript docs)
Returns a data URI containing a representation of the image in the format specified by the
type parameter (defaults to PNG). The returned image is in a resolution of 96 dpi.
(JavaScript docs)
Creates a Blob object representing the image contained in the canvas; this file may be
cached on the disk or stored in memory at the discretion of the user agent.
(JavaScript docs)
type Error = ConversionError
The type returned in the event of a conversion error.
type Error = ConversionError
The type returned in the event of a conversion error.
type Error = ConversionError
The type returned in the event of a conversion error.
type Error = ConversionError
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.
type Error = ConversionError
The type returned in the event of a conversion error.
type Error = ConversionError
The type returned in the event of a conversion error.
type Error = ConversionError
The type returned in the event of a conversion error.
type Error = ConversionError
The type returned in the event of a conversion error.
Checks whenever a given Reference if of type Self
.
Converts a given reference into a concrete reference-like wrapper. Doesn't do any type checking; highly unsafe to use! Read more
Adds given event handler to the list of event listeners for the specified EventTarget
on which it's called. Read more
Dispatches an Event
at this EventTarget
, invoking the affected event listeners in the appropriate order. Read more
Casts a reference to this object into a reference to a Node.
Adds a node to the end of the list of children of a specified parent node. Read more
Returns a duplicate of the node on which this method was called. Read more
Checks whenever a given node is a descendant of this one or not. Read more
Inserts the specified node before the reference node as a child of the current node. Read more
Replaces one hild node of the specified node with another. Read more
Returns the parent of this node in the DOM tree. Read more
Returns the node's first child in the tree, or None
if the node is childless. Read more
Returns the node's last child in the tree, or None
if the node is childless. Read more
Returns the node's next sibling in the tree, or None
if there isn't such a node. Read more
Returns the Document
that this node belongs to. Read more
Returns an Element
that is the parent of this node. Returns null
if the node has no parent or the parent is not an Element
. Read more
Returns the node's previous sibling in the tree, or None
if there isn't such a node. Read more
A property which represents the text content of a node and its descendants. Read more
Sets the text content of this node; calling thil removes all of node's children and replaces them with a single text node with the given value. Read more
Returns a live collection of child nodes of this node. Read more
Returns whether this node has children nodes. Read more
Determines whether the given namespace is the default namespace of this node. Read more
Tests whether this node is equal to another node. Two nodes are equal if they have the same type, defining characteristics, matching attributes, and so on. Read more
Test whether two Node
references are the same. Read more
Returns the prefix for the given namespace URI, if present. Read more
Returns the namespace URI for the given prefix. Read more
Merges any adjacent text nodes and removes empty text nodes under this node. Read more
The Element.namespaceURI read-only property returns the namespace URI of the element, or null if the element is not in a namespace. Read more
The Element.classList is a read-only property which returns a live TokenList collection of the class attributes of the element. Read more
The Element.hasAttribute() method returns a Boolean value indicating whether the specified element has the specified attribute or not. Read more
Element.getAttribute() returns the value of a specified attribute on the element. If the given attribute does not exist, the value returned will either be null or "" (the empty string); Read more
Sets the value of an attribute on the specified element. If the attribute already exists, the value is updated; otherwise a new attribute is added with the specified name and value. Read more
Gets the the number of pixels that an element's content is scrolled vertically. Read more
Sets the the number of pixels that an element's content is scrolled vertically. Read more
Gets the the number of pixels that an element's content is scrolled to the left. Read more
Sets the the number of pixels that an element's content is scrolled to the left. Read more
Element.getAttributeNames() returns the attribute names of the element as an Array of strings. If the element has no attributes it returns an empty array. Read more
Element.removeAttribute removes an attribute from the specified element. Read more
The Element.hasAttributes() method returns Boolean value, indicating if the current element has any attributes or not. Read more
Returns the closest ancestor of the element (or the element itself) which matches the selectors given in parameter. If there isn't such an ancestor, it returns None
. Read more
Designates a specific element as the capture target of future pointer events. Read more
Releases pointer capture that was previously set for a specific pointer Read more
Returns a boolean indicating if the element has captured the specified pointer Read more
Insert nodes from HTML fragment into specified position. Read more
Insert nodes from HTML fragment before element. Read more
Insert nodes from HTML fragment as the first children of the element. Read more
Insert nodes from HTML fragment as the last children of the element. Read more
Insert nodes from HTML fragment after element. Read more
The slot property of the Element interface returns the name of the shadow DOM slot the element is inserted in. Read more
Attach a shadow DOM tree to the specified element and returns a reference to its ShadowRoot
. It returns a shadow root if successfully attached or None
if the element cannot be attached. Read more
Returns the shadow root of the current element or None
. Read more
Sets focus on the specified element, if it can be focused. Read more
Removes keyboard focus from the current element. Read more
Allows access, both in reading and writing, to all of the custom data attributes (data-*) set on the element, either in HTML or in the DOM. Read more
Returns the size of an element and its position relative to the viewport. (JavaScript docs) Read more
Returns the layout width of an element. Typically, an element's offsetWidth is a measurement which includes the element borders, the element horizontal padding, the element vertical scrollbar (if present, if rendered) and the element CSS width. Read more
Returns the height of the element including vertical padding and borders, as an integer. Read more
A property which represents the "rendered" text content of a node and its descendants. It approximates the text the user would get if they highlighted the contents of the element with the cursor and then copied to the clipboard. Read more
Performs copy-assignment from source
. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Formats the value using the given formatter. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static