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.
Provided Methods§
Sourcefn dataset(&self) -> StringMap
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.
Sourcefn get_bounding_client_rect(&self) -> Rect
fn get_bounding_client_rect(&self) -> Rect
Returns the size of an element and its position relative to the viewport. (JavaScript docs)
Sourcefn offset_width(&self) -> i32
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.
Sourcefn offset_height(&self) -> i32
fn offset_height(&self) -> i32
Returns the height of the element including vertical padding and borders, as an integer.
Sourcefn inner_text(&self) -> String
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.
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.