Trait parcel_selectors::parser::Parser
source · pub trait Parser<'i> {
type Impl: SelectorImpl<'i>;
type Error: 'i + From<SelectorParseErrorKind<'i>>;
Show 13 methods
fn parse_slotted(&self) -> bool { ... }
fn parse_part(&self) -> bool { ... }
fn parse_is_and_where(&self) -> bool { ... }
fn is_and_where_error_recovery(&self) -> ParseErrorRecovery { ... }
fn parse_any_prefix(
&self,
_name: &str
) -> Option<<Self::Impl as SelectorImpl<'i>>::VendorPrefix> { ... }
fn parse_host(&self) -> bool { ... }
fn parse_non_ts_pseudo_class(
&self,
location: SourceLocation,
name: CowRcStr<'i>
) -> Result<<Self::Impl as SelectorImpl<'i>>::NonTSPseudoClass, ParseError<'i, Self::Error>> { ... }
fn parse_non_ts_functional_pseudo_class<'t>(
&self,
name: CowRcStr<'i>,
arguments: &mut CssParser<'i, 't>
) -> Result<<Self::Impl as SelectorImpl<'i>>::NonTSPseudoClass, ParseError<'i, Self::Error>> { ... }
fn parse_pseudo_element(
&self,
location: SourceLocation,
name: CowRcStr<'i>
) -> Result<<Self::Impl as SelectorImpl<'i>>::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<'i>>::PseudoElement, ParseError<'i, Self::Error>> { ... }
fn default_namespace(
&self
) -> Option<<Self::Impl as SelectorImpl<'i>>::NamespaceUrl> { ... }
fn namespace_for_prefix(
&self,
_prefix: &<Self::Impl as SelectorImpl<'i>>::NamespacePrefix
) -> Option<<Self::Impl as SelectorImpl<'i>>::NamespaceUrl> { ... }
fn is_nesting_allowed(&self) -> bool { ... }
}
Required Associated Types
type Impl: SelectorImpl<'i>
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_is_and_where(&self) -> bool
fn parse_is_and_where(&self) -> bool
Whether to parse the :where
pseudo-class.
sourcefn is_and_where_error_recovery(&self) -> ParseErrorRecovery
fn is_and_where_error_recovery(&self) -> ParseErrorRecovery
The error recovery that selector lists inside :is() and :where() have.
sourcefn parse_any_prefix(
&self,
_name: &str
) -> Option<<Self::Impl as SelectorImpl<'i>>::VendorPrefix>
fn parse_any_prefix(
&self,
_name: &str
) -> Option<<Self::Impl as SelectorImpl<'i>>::VendorPrefix>
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 parse_non_ts_pseudo_class(
&self,
location: SourceLocation,
name: CowRcStr<'i>
) -> Result<<Self::Impl as SelectorImpl<'i>>::NonTSPseudoClass, ParseError<'i, Self::Error>>
fn parse_non_ts_pseudo_class(
&self,
location: SourceLocation,
name: CowRcStr<'i>
) -> Result<<Self::Impl as SelectorImpl<'i>>::NonTSPseudoClass, ParseError<'i, Self::Error>>
Parses non-tree-structural pseudo-classes. Tree structural pseudo-classes,
like :first-child
, are built into this library.
This function can return an “Err” pseudo-element in order to support CSS2.1 pseudo-elements.