pub trait Parser<'i> {
type Impl: SelectorImpl;
type Error: 'i + From<SelectorParseErrorKind<'i>>;
Show 15 methods
// Provided methods
fn parse_slotted(&self) -> bool { ... }
fn parse_part(&self) -> bool { ... }
fn parse_nth_child_of(&self) -> bool { ... }
fn parse_is_and_where(&self) -> bool { ... }
fn parse_has(&self) -> bool { ... }
fn parse_parent_selector(&self) -> bool { ... }
fn is_is_alias(&self, _name: &str) -> bool { ... }
fn parse_host(&self) -> bool { ... }
fn allow_forgiving_selectors(&self) -> bool { ... }
fn parse_non_ts_pseudo_class(
&self,
location: SourceLocation,
name: CowRcStr<'i>,
) -> Result<<Self::Impl as SelectorImpl>::NonTSPseudoClass, ParseError<'i, Self::Error>> { ... }
fn parse_non_ts_functional_pseudo_class<'t>(
&self,
name: CowRcStr<'i>,
parser: &mut CssParser<'i, 't>,
_after_part: bool,
) -> Result<<Self::Impl as SelectorImpl>::NonTSPseudoClass, ParseError<'i, Self::Error>> { ... }
fn parse_pseudo_element(
&self,
location: SourceLocation,
name: CowRcStr<'i>,
) -> Result<<Self::Impl as SelectorImpl>::PseudoElement, ParseError<'i, Self::Error>> { ... }
fn parse_functional_pseudo_element<'t>(
&self,
name: CowRcStr<'i>,
arguments: &mut CssParser<'i, 't>,
) -> Result<<Self::Impl as SelectorImpl>::PseudoElement, ParseError<'i, Self::Error>> { ... }
fn default_namespace(
&self,
) -> Option<<Self::Impl as SelectorImpl>::NamespaceUrl> { ... }
fn namespace_for_prefix(
&self,
_prefix: &<Self::Impl as SelectorImpl>::NamespacePrefix,
) -> Option<<Self::Impl as SelectorImpl>::NamespaceUrl> { ... }
}
Required Associated Types§
type Impl: SelectorImpl
type Error: 'i + From<SelectorParseErrorKind<'i>>
Provided Methods§
sourcefn parse_slotted(&self) -> bool
fn parse_slotted(&self) -> bool
Whether to parse the ::slotted()
pseudo-element.
sourcefn parse_part(&self) -> bool
fn parse_part(&self) -> bool
Whether to parse the ::part()
pseudo-element.
sourcefn parse_nth_child_of(&self) -> bool
fn parse_nth_child_of(&self) -> bool
Whether to parse the selector list of nth-child() or nth-last-child().
sourcefn parse_is_and_where(&self) -> bool
fn parse_is_and_where(&self) -> bool
Whether to parse :is
and :where
pseudo-classes.
sourcefn parse_parent_selector(&self) -> bool
fn parse_parent_selector(&self) -> bool
Whether to parse the ‘&’ delimiter as a parent selector.
sourcefn is_is_alias(&self, _name: &str) -> bool
fn is_is_alias(&self, _name: &str) -> bool
Whether the given function name is an alias for the :is()
function.
sourcefn parse_host(&self) -> bool
fn parse_host(&self) -> bool
Whether to parse the :host
pseudo-class.
sourcefn allow_forgiving_selectors(&self) -> bool
fn allow_forgiving_selectors(&self) -> bool
Whether to allow forgiving selector-list parsing.
sourcefn parse_non_ts_pseudo_class(
&self,
location: SourceLocation,
name: CowRcStr<'i>,
) -> Result<<Self::Impl as SelectorImpl>::NonTSPseudoClass, ParseError<'i, Self::Error>>
fn parse_non_ts_pseudo_class( &self, location: SourceLocation, name: CowRcStr<'i>, ) -> Result<<Self::Impl as SelectorImpl>::NonTSPseudoClass, ParseError<'i, Self::Error>>
This function can return an “Err” pseudo-element in order to support CSS2.1 pseudo-elements.