Trait selectors::parser::SelectorImpl [] [src]

pub trait SelectorImpl: Sized + Debug {
    type AttrValue: Clone + Display + MaybeHeapSizeOf + Eq + FromCowStr;
    type Identifier: Clone + Display + MaybeHeapSizeOf + Eq + FromCowStr + Hash + BloomHash;
    type ClassName: Clone + Display + MaybeHeapSizeOf + Eq + FromCowStr + Hash + BloomHash;
    type LocalName: Clone + Display + MaybeHeapSizeOf + Eq + FromCowStr + Hash + BloomHash + Borrow<Self::BorrowedLocalName>;
    type NamespaceUrl: Clone + Display + MaybeHeapSizeOf + Eq + Default + Hash + BloomHash + Borrow<Self::BorrowedNamespaceUrl>;
    type NamespacePrefix: Clone + Display + MaybeHeapSizeOf + Eq + Default + Hash + FromCowStr;
    type BorrowedNamespaceUrl: ?Sized + Eq;
    type BorrowedLocalName: ?Sized + Eq + Hash;
    type NonTSPseudoClass: Sized + PartialEq + Clone + MaybeHeapSizeOf + ToCss;
    type PseudoElement: Sized + PartialEq + Eq + Clone + Hash + MaybeHeapSizeOf + ToCss;
    fn attr_exists_selector_is_shareable(_attr_selector: &AttrSelector<Self>) -> bool { ... }
    fn attr_equals_selector_is_shareable(_attr_selector: &AttrSelector<Self>, _value: &Self::AttrValue) -> bool { ... }
    fn parse_non_ts_pseudo_class(_context: &ParserContext<Self>, _name: &str) -> Result<Self::NonTSPseudoClass, ()> { ... }
    fn parse_non_ts_functional_pseudo_class(_context: &ParserContext<Self>, _name: &str, _arguments: &mut Parser) -> Result<Self::NonTSPseudoClass, ()> { ... }
    fn parse_pseudo_element(_context: &ParserContext<Self>, _name: &str) -> Result<Self::PseudoElement, ()> { ... }
}

This trait allows to define the parser implementation in regards of pseudo-classes/elements

Associated Types

Provided Methods

fn attr_exists_selector_is_shareable(_attr_selector: &AttrSelector<Self>) -> bool

Declares if the following "attribute exists" selector is considered "common" enough to be shareable. If that's not the case, when matching over an element, the relation AFFECTED_BY_NON_COMMON_STYLE_AFFECTING_ATTRIBUTE would be set.

fn attr_equals_selector_is_shareable(_attr_selector: &AttrSelector<Self>, _value: &Self::AttrValue) -> bool

Declares if the following "equals" attribute selector is considered "common" enough to be shareable.

fn parse_non_ts_pseudo_class(_context: &ParserContext<Self>, _name: &str) -> Result<Self::NonTSPseudoClass, ()>

This function can return an "Err" pseudo-element in order to support CSS2.1 pseudo-elements.

fn parse_non_ts_functional_pseudo_class(_context: &ParserContext<Self>, _name: &str, _arguments: &mut Parser) -> Result<Self::NonTSPseudoClass, ()>

fn parse_pseudo_element(_context: &ParserContext<Self>, _name: &str) -> Result<Self::PseudoElement, ()>

Implementors