Trait IHtmlElement

Source
pub trait IHtmlElement: IElement {
    // Provided methods
    fn focus(&self) { ... }
    fn blur(&self) { ... }
    fn dataset(&self) -> StringMap { ... }
    fn get_bounding_client_rect(&self) -> Rect { ... }
    fn offset_width(&self) -> i32 { ... }
    fn offset_height(&self) -> i32 { ... }
    fn inner_text(&self) -> String { ... }
}
Expand description

The IHtmlElement interface represents any HTML element.

(JavaScript docs)

Provided Methods§

Source

fn focus(&self)

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

(JavaScript docs)

Source

fn blur(&self)

Removes keyboard focus from the current element.

(JavaScript docs)

Source

fn dataset(&self) -> StringMap

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.

(JavaScript docs)

Source

fn get_bounding_client_rect(&self) -> Rect

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

Source

fn offset_width(&self) -> i32

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.

Source

fn offset_height(&self) -> i32

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

Source

fn inner_text(&self) -> String

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.

This feature was originally introduced by Internet Explorer, and was formally specified in the HTML standard in 2016 after being adopted by all major browser vendors.

(JavaScript docs)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§