Trait moxie_dom::interfaces::element::ElementBuilder[][src]

pub trait ElementBuilder: NodeWrapper {
    fn attribute(self, name: &'static str, value: impl AsRef<str>) -> Self { ... }
fn class(self, to_set: impl ToString) -> Self { ... }
fn id(self, to_set: impl ToString) -> Self { ... }
fn style(self, to_set: impl ToString) -> Self { ... } }
Expand description

Element is the most general base class from which all element objects (i.e. objects that represent elements) in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element. For example, the HTMLElement interface is the base interface for HTML elements, while the SVGElement interface is the basis for all SVG elements. Most functionality is specified further down the class hierarchy.

Note: this trait cannot be implemented outside of this crate.

Provided methods

Declare an attribute of the element, mutating the actual element’s attribute when the passed value changes.

A guard value is stored as a resulting “effect” of the mutation, and removes the attribute when dropped, to ensure that the attribute is removed when this declaration is no longer referenced in the most recent (moxie::Revision).

Updates the element’s class.

Updates the element’s id.

Updates the element’s style.