script::dom::node

Trait NodeTraits

Source
pub(crate) trait NodeTraits {
    // Required methods
    fn owner_document(&self) -> DomRoot<Document>;
    fn owner_window(&self) -> DomRoot<Window>;
    fn owner_global(&self) -> DomRoot<GlobalScope>;
    fn containing_shadow_root(&self) -> Option<DomRoot<ShadowRoot>>;
    fn stylesheet_list_owner(&self) -> StyleSheetListOwner;
}

Required Methods§

Source

fn owner_document(&self) -> DomRoot<Document>

Get the Document that owns this node. Note that this may differ from the Document that the node was created in if it was adopted by a different Document (the owner).

Source

fn owner_window(&self) -> DomRoot<Window>

Get the Window of the Document that owns this node. Note that this may differ from the Document that the node was created in if it was adopted by a different Document (the owner).

Source

fn owner_global(&self) -> DomRoot<GlobalScope>

Get the GlobalScope of the Document that owns this node. Note that this may differ from the GlobalScope that the node was created in if it was adopted by a different Document (the owner).

Source

fn containing_shadow_root(&self) -> Option<DomRoot<ShadowRoot>>

If this Node is contained in a ShadowRoot return it, otherwise None.

Source

fn stylesheet_list_owner(&self) -> StyleSheetListOwner

Get the stylesheet owner for this node: either the Document or the ShadowRoot of the node.

Implementors§