Struct stdweb::web::html_element::CanvasElement [] [src]

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)

Methods

impl CanvasElement
[src]

[src]

Returns a positive integer reflecting the height HTML attribute of the element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used.

(JavaScript docs)

[src]

Sets a positive integer reflecting the height HTML attribute of the element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used.

(JavaScript docs)

[src]

Returns a positive integer reflecting the width HTML attribute of the element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used.

(JavaScript docs)

[src]

Sets a positive integer reflecting the width HTML attribute of the element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used.

(JavaScript docs)

[src]

Returns a drawing context on the canvas, or None if the context identifier is not supported.

(JavaScript docs)

[src]

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)

[src]

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)

Trait Implementations

impl Clone for CanvasElement
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for CanvasElement
[src]

[src]

Formats the value using the given formatter. Read more

impl PartialEq for CanvasElement
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for CanvasElement
[src]

impl From<CanvasElement> for EventTarget
[src]

[src]

Performs the conversion.

impl TryFrom<EventTarget> for CanvasElement
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl From<CanvasElement> for Node
[src]

[src]

Performs the conversion.

impl TryFrom<Node> for CanvasElement
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl From<CanvasElement> for Element
[src]

[src]

Performs the conversion.

impl TryFrom<Element> for CanvasElement
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl From<CanvasElement> for HtmlElement
[src]

[src]

Performs the conversion.

impl TryFrom<HtmlElement> for CanvasElement
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl InstanceOf for CanvasElement
[src]

[src]

Checks whenever a given Reference if of type Self.

impl AsRef<Reference> for CanvasElement
[src]

[src]

Performs the conversion.

impl ReferenceType for CanvasElement
[src]

[src]

Converts a given reference into a concrete reference-like wrapper. Doesn't do any type checking; highly unsafe to use! Read more

impl From<CanvasElement> for Reference
[src]

[src]

Performs the conversion.

impl TryFrom<CanvasElement> for Reference
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl TryFrom<Reference> for CanvasElement
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl<'_r> TryFrom<&'_r Reference> for CanvasElement
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl TryFrom<Value> for CanvasElement
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl<'_r> TryFrom<&'_r Value> for CanvasElement
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl JsSerialize for CanvasElement
[src]

impl IEventTarget for CanvasElement
[src]

[src]

Adds given event handler to the list of event listeners for the specified EventTarget on which it's called. Read more

[src]

Dispatches an Event at this EventTarget, invoking the affected event listeners in the appropriate order. Read more

impl INode for CanvasElement
[src]

[src]

Casts a reference to this object into a reference to a Node.

[src]

Adds a node to the end of the list of children of a specified parent node. Read more

[src]

Removes a child node from the DOM. Read more

[src]

Returns a duplicate of the node on which this method was called. Read more

[src]

Checks whenever a given node is a descendant of this one or not. Read more

[src]

Inserts the specified node before the reference node as a child of the current node. Read more

[src]

Replaces one hild node of the specified node with another. Read more

[src]

Returns the parent of this node in the DOM tree. Read more

[src]

Returns the node's first child in the tree, or None if the node is childless. Read more

[src]

Returns the node's last child in the tree, or None if the node is childless. Read more

[src]

Returns the node's next sibling in the tree, or None if there isn't such a node. Read more

[src]

Returns the name of the node. Read more

[src]

Returns the type of the node. Read more

[src]

Returns the value of the node. Read more

[src]

Sets the value of the node. Read more

[src]

Returns the Document that this node belongs to. Read more

[src]

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

[src]

Returns the node's previous sibling in the tree, or None if there isn't such a node. Read more

[src]

A property which represents the text content of a node and its descendants. Read more

[src]

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

[src]

Returns a live collection of child nodes of this node. Read more

[src]

Gets the base URL. Read more

[src]

Returns whether this node has children nodes. Read more

[src]

Determines whether the given namespace is the default namespace of this node. Read more

[src]

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

[src]

Test whether two Node references are the same. Read more

[src]

Returns the prefix for the given namespace URI, if present. Read more

[src]

Returns the namespace URI for the given prefix. Read more

[src]

Merges any adjacent text nodes and removes empty text nodes under this node. Read more

impl IElement for CanvasElement
[src]

[src]

The Element.classList is a read-only property which returns a live TokenList collection of the class attributes of the element. Read more

[src]

The Element.hasAttribute() method returns a Boolean value indicating whether the specified element has the specified attribute or not. Read more

[src]

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

[src]

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

[src]

Gets the the number of pixels that an element's content is scrolled vertically. Read more

[src]

Sets the the number of pixels that an element's content is scrolled vertically. Read more

[src]

Gets the the number of pixels that an element's content is scrolled to the left. Read more

[src]

Sets the the number of pixels that an element's content is scrolled to the left. Read more

[src]

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

[src]

Element.removeAttribute removes an attribute from the specified element. Read more

[src]

The Element.hasAttributes() method returns Boolean value, indicating if the current element has any attributes or not. Read more

[src]

Designates a specific element as the capture target of future pointer events. Read more

[src]

Releases pointer capture that was previously set for a specific pointer Read more

[src]

Returns a boolean indicating if the element has captured the specified pointer Read more

impl IHtmlElement for CanvasElement
[src]

[src]

Sets focus on the specified element, if it can be focused. Read more

[src]

Removes keyboard focus from the current element. Read more

[src]

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

[src]

Returns the size of an element and its position relative to the viewport. (JavaScript docs) Read more

[src]

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

[src]

Returns the height of the element including vertical padding and borders, as an integer. Read more

[src]

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

Auto Trait Implementations

impl Send for CanvasElement

impl Sync for CanvasElement