[][src]Trait stdweb::web::IElement

pub trait IElement: INode + IParentNode + IChildNode + ISlotable {
    fn namespace_uri(&self) -> Option<String> { ... }
fn class_list(&self) -> TokenList { ... }
fn has_attribute(&self, name: &str) -> bool { ... }
fn get_attribute(&self, name: &str) -> Option<String> { ... }
fn set_attribute(
        &self,
        name: &str,
        value: &str
    ) -> Result<(), InvalidCharacterError> { ... }
fn scroll_top(&self) -> f64 { ... }
fn set_scroll_top(&self, value: f64) { ... }
fn scroll_left(&self) -> f64 { ... }
fn set_scroll_left(&self, value: f64) { ... }
fn get_attribute_names(&self) -> Vec<String> { ... }
fn remove_attribute(&self, name: &str) { ... }
fn has_attributes(&self) -> bool { ... }
fn closest(&self, selectors: &str) -> Result<Option<Element>, SyntaxError> { ... }
fn set_pointer_capture(
        &self,
        pointer_id: i32
    ) -> Result<(), InvalidPointerId> { ... }
fn release_pointer_capture(
        &self,
        pointer_id: i32
    ) -> Result<(), InvalidPointerId> { ... }
fn has_pointer_capture(&self, pointer_id: i32) -> bool { ... }
fn insert_adjacent_html(
        &self,
        position: InsertPosition,
        html: &str
    ) -> Result<(), InsertAdjacentError> { ... }
fn insert_html_before(&self, html: &str) -> Result<(), InsertAdjacentError> { ... }
fn prepend_html(&self, html: &str) -> Result<(), InsertAdjacentError> { ... }
fn append_html(&self, html: &str) -> Result<(), InsertAdjacentError> { ... }
fn insert_html_after(&self, html: &str) -> Result<(), InsertAdjacentError> { ... }
fn slot(&self) -> String { ... }
fn attach_shadow(
        &self,
        mode: ShadowRootMode
    ) -> Result<ShadowRoot, AttachShadowError> { ... }
fn shadow_root(&self) -> Option<ShadowRoot> { ... } }

The IElement interface represents an object of a Document. This interface describes methods and properties common to all kinds of elements.

(JavaScript docs)

Provided methods

fn namespace_uri(&self) -> Option<String>

The Element.namespaceURI read-only property returns the namespace URI of the element, or null if the element is not in a namespace.

(JavaScript docs)

fn class_list(&self) -> TokenList

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

(JavaScript docs)

fn has_attribute(&self, name: &str) -> bool

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

(JavaScript docs)

fn get_attribute(&self, name: &str) -> Option<String>

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);

(Javascript docs)

fn set_attribute(
    &self,
    name: &str,
    value: &str
) -> Result<(), InvalidCharacterError>

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.

(Javascript docs)

fn scroll_top(&self) -> f64

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

(Javascript docs)

fn set_scroll_top(&self, value: f64)

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

(Javascript docs)

fn scroll_left(&self) -> f64

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

(Javascript docs)

fn set_scroll_left(&self, value: f64)

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

(Javascript docs)

fn get_attribute_names(&self) -> Vec<String>

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.

(Javascript docs)

fn remove_attribute(&self, name: &str)

Element.removeAttribute removes an attribute from the specified element.

(Javascript docs)

fn has_attributes(&self) -> bool

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

(Javascript docs)

fn closest(&self, selectors: &str) -> Result<Option<Element>, SyntaxError>

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.

(JavaScript docs)

fn set_pointer_capture(&self, pointer_id: i32) -> Result<(), InvalidPointerId>

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

(JavaScript docs)

fn release_pointer_capture(
    &self,
    pointer_id: i32
) -> Result<(), InvalidPointerId>

Releases pointer capture that was previously set for a specific pointer

(JavaScript docs)

fn has_pointer_capture(&self, pointer_id: i32) -> bool

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

(JavaScript docs)

fn insert_adjacent_html(
    &self,
    position: InsertPosition,
    html: &str
) -> Result<(), InsertAdjacentError>

Insert nodes from HTML fragment into specified position.

(JavaScript docs)

fn insert_html_before(&self, html: &str) -> Result<(), InsertAdjacentError>

Insert nodes from HTML fragment before element.

(JavaScript docs)

fn prepend_html(&self, html: &str) -> Result<(), InsertAdjacentError>

Insert nodes from HTML fragment as the first children of the element.

(JavaScript docs)

fn append_html(&self, html: &str) -> Result<(), InsertAdjacentError>

Insert nodes from HTML fragment as the last children of the element.

(JavaScript docs)

fn insert_html_after(&self, html: &str) -> Result<(), InsertAdjacentError>

Insert nodes from HTML fragment after element.

(JavaScript docs)

fn slot(&self) -> String

The slot property of the Element interface returns the name of the shadow DOM slot the element is inserted in.

(JavaScript docs)

fn attach_shadow(
    &self,
    mode: ShadowRootMode
) -> Result<ShadowRoot, AttachShadowError>

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.

(JavaScript docs)

fn shadow_root(&self) -> Option<ShadowRoot>

Returns the shadow root of the current element or None.

(JavaScript docs)

Loading content...

Implementors

impl IElement for CanvasElement[src]

impl IElement for ImageElement[src]

impl IElement for InputElement[src]

impl IElement for OptionElement[src]

impl IElement for SelectElement[src]

impl IElement for SlotElement[src]

impl IElement for TemplateElement[src]

impl IElement for TextAreaElement[src]

impl IElement for Element[src]

impl IElement for HtmlElement[src]

Loading content...