Trait parcel_selectors::visitor::SelectorVisitor

source ·
pub trait SelectorVisitor<'i>: Sized {
    type Impl: SelectorImpl<'i>;

    // Provided methods
    fn visit_attribute_selector(
        &mut self,
        _namespace: &NamespaceConstraint<&<Self::Impl as SelectorImpl<'i>>::NamespaceUrl>,
        _local_name: &<Self::Impl as SelectorImpl<'i>>::LocalName,
        _local_name_lower: &<Self::Impl as SelectorImpl<'i>>::LocalName
    ) -> bool { ... }
    fn visit_simple_selector(&mut self, _: &Component<'i, Self::Impl>) -> bool { ... }
    fn visit_selector_list(&mut self, list: &[Selector<'i, Self::Impl>]) -> bool { ... }
    fn visit_complex_selector(
        &mut self,
        _combinator_to_right: Option<Combinator>
    ) -> bool { ... }
}
Expand description

A trait to visit selector properties.

All the visit_foo methods return a boolean indicating whether the traversal should continue or not.

Required Associated Types§

source

type Impl: SelectorImpl<'i>

The selector implementation this visitor wants to visit.

Provided Methods§

source

fn visit_attribute_selector( &mut self, _namespace: &NamespaceConstraint<&<Self::Impl as SelectorImpl<'i>>::NamespaceUrl>, _local_name: &<Self::Impl as SelectorImpl<'i>>::LocalName, _local_name_lower: &<Self::Impl as SelectorImpl<'i>>::LocalName ) -> bool

Visit an attribute selector that may match (there are other selectors that may never match, like those containing whitespace or the empty string).

source

fn visit_simple_selector(&mut self, _: &Component<'i, Self::Impl>) -> bool

Visit a simple selector.

source

fn visit_selector_list(&mut self, list: &[Selector<'i, Self::Impl>]) -> bool

Visit a nested selector list. The caller is responsible to call visit into the internal selectors if / as needed.

The default implementation does this.

source

fn visit_complex_selector( &mut self, _combinator_to_right: Option<Combinator> ) -> bool

Visits a complex selector.

Gets the combinator to the right of the selector, or None if the selector is the rightmost one.

Object Safety§

This trait is not object safe.

Implementors§