Trait style::dom::TShadowRoot

source ·
pub trait TShadowRoot:
    Sized
    + Copy
    + Clone
    + Debug
    + PartialEq {
    type ConcreteNode: TNode<ConcreteShadowRoot = Self>;

    // Required methods
    fn as_node(&self) -> Self::ConcreteNode;
    fn host(&self) -> <Self::ConcreteNode as TNode>::ConcreteElement;
    fn style_data<'a>(&self) -> Option<&'a CascadeData>
       where Self: 'a;

    // Provided methods
    fn parts<'a>(&self) -> &[<Self::ConcreteNode as TNode>::ConcreteElement]
       where Self: 'a { ... }
    fn elements_with_id<'a>(
        &self,
        _id: &AtomIdent,
    ) -> Result<&'a [<Self::ConcreteNode as TNode>::ConcreteElement], ()>
       where Self: 'a { ... }
    fn implicit_scope_for_sheet(
        &self,
        _sheet_index: usize,
    ) -> Option<ImplicitScopeRoot> { ... }
}
Expand description

The ShadowRoot trait.

Required Associated Types§

source

type ConcreteNode: TNode<ConcreteShadowRoot = Self>

The concrete node type.

Required Methods§

source

fn as_node(&self) -> Self::ConcreteNode

Get this ShadowRoot as a node.

source

fn host(&self) -> <Self::ConcreteNode as TNode>::ConcreteElement

Get the shadow host that hosts this ShadowRoot.

source

fn style_data<'a>(&self) -> Option<&'a CascadeData>
where Self: 'a,

Get the style data for this ShadowRoot.

Provided Methods§

source

fn parts<'a>(&self) -> &[<Self::ConcreteNode as TNode>::ConcreteElement]
where Self: 'a,

Get the list of shadow parts for this shadow root.

source

fn elements_with_id<'a>( &self, _id: &AtomIdent, ) -> Result<&'a [<Self::ConcreteNode as TNode>::ConcreteElement], ()>
where Self: 'a,

Get a list of elements with a given ID in this shadow root, sorted by tree position.

Can return an error to signal that this list is not available, or also return an empty slice.

source

fn implicit_scope_for_sheet( &self, _sheet_index: usize, ) -> Option<ImplicitScopeRoot>

Get the implicit scope for a stylesheet in given index.

Object Safety§

This trait is not object safe.

Implementors§