Skip to main content

NodeTraits

Trait NodeTraits 

Source
pub(crate) trait NodeTraits {
    // Required methods
    fn owner_document(&self) -> DomRoot<Document>;
    fn owner_document_unrooted<'no_gc>(
        &self,
        no_gc: &'no_gc NoGC,
    ) -> UnrootedDom<'no_gc, Document>;
    fn owner_window(&self) -> DomRoot<Window>;
    fn owner_window_unrooted<'no_gc>(
        &self,
        no_gc: &'no_gc NoGC,
    ) -> UnrootedDom<'no_gc, 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_document_unrooted<'no_gc>( &self, no_gc: &'no_gc NoGC, ) -> UnrootedDom<'no_gc, 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_window_unrooted<'no_gc>( &self, no_gc: &'no_gc NoGC, ) -> UnrootedDom<'no_gc, 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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§