Skip to main content Module parser Copy item path Source pub use crate::visitor::SelectorVisitor ;with_all_bounds π with_bounds π AnPlusB The properties that comprise an An+B syntax AncestorHashes Ancestor hashes for the bloom filter. We precompute these and store them
inline with selectors to optimize cache performance during matching.
This matters a lot. AncestorIter π An iterator over all simple selectors belonging to ancestors. CombinatorComposition π Composition of combinators in a given selector, not traversing selectors of pseudoclasses. CombinatorIter π An iterator over all combinators in a selector. Does not traverse selectors within psuedoclasses. LocalName NthOfSelectorData The properties that comprise an :nth- pseudoclass as of Selectors 4 (e.g.,
nth-child(An+B [of S]?)).
https://www.w3.org/TR/selectors-4/#nth-child-pseudo NthSelectorData The properties that comprise an :nth- pseudoclass as of Selectors 3 (e.g.,
nth-child(An+B)).
https://www.w3.org/TR/selectors-3/#nth-child-pseudo RelativeSelector Storage for a relative selector. RelativeSelectorCombinatorCount Count of combinators in a given relative selector, not traversing selectors of pseudoclasses. Selector A Selector stores a sequence of simple selectors and combinators. The
iterator classes allow callers to iterate at either the raw sequence level or
at the level of sequences of simple selectors separated by combinators. Most
callers want the higher-level iterator. SelectorIter SelectorKey Uniquely identify a selector based on its components, which is behind ThinArc and
is therefore stable. SelectorList A selector list is a tagged pointer with either a single selector, or a ThinArc<()> of multiple
selectors. SelectorParsingState π Flags that indicate at which point of parsing a selector are we. AttributeFlags π An attribute selector can have βsβ or βiβ as flags, or no flags at all. Combinator Component A CSS simple selector or combinator. We store both in the same enum for
optimal packing and cache performance, see [1]. ForgivingParsing π Whether or not weβre using forgiving parsing mode MatchesFeaturelessHost Whether a selector may match a featureless host element, and whether it may match other
elements. NthType An enum for the different types of :nth- pseudoclasses ParseRelative Flag indicating if weβre parsing relative selectors. QNamePrefix π RelativeSelectorMatchHint Flag indicating where a given relative selectorβs match would be contained. SelectorParseErrorKind SimpleSelectorParseResult π NonTSPseudoClass A trait that represents a pseudo-class. Parser PseudoElement A trait that represents a pseudo-element. SelectorImpl This trait allows to define the parser implementation in regards
of pseudo-classes/elements collect_ancestor_hashes π collect_selector_hashes π is_ascii_case_insensitive_html_attribute π Whether name, which must already be ASCII-lowercased, is an attribute that HTML matches
ASCII-case-insensitively, as per1 . is_css2_pseudo_element Returns whether the name corresponds to a CSS2 pseudo-element that
can be specified with the single colon syntax (in addition to the
double-colon syntax, which can be used for all pseudo-elements). namespace_empty_string parse_attribute_flags π parse_attribute_selector π parse_compound_selector π simple_selector_sequence
: [ type_selector | universal ] [ HASH | class | attrib | pseudo | negation ]*
| [ HASH | class | attrib | pseudo | negation ]+ parse_functional_pseudo_class π parse_has π parse_inner_compound_selector π Parses one compound selector suitable for nested stuff like :-moz-any, etc. parse_is_where π parse_negation π Level 3: Parse one simple_selector. (Though we might insert a second
implied β|*β type selector.) parse_nth_pseudo_class π parse_one_simple_selector π Parse a simple selector other than a type selector. parse_qualified_name π Err(()): Invalid selector, abortOk(None): Not a simple selector, could be something else. input was not consumed.Ok(Some((namespace, local_name))): None for the local name means a * universal selectorparse_selector π Build up a Selector.
selector : simple_selector_sequence [ combinator simple_selector_sequence ]* ; parse_simple_pseudo_class π parse_type_selector π Err(()): Invalid selector, abortOk(false): Not a type selector, could be something else. input was not consumed.Ok(true): Length 0 (*|*), 1 (*|E or ns|*) or 2 (|E or ns|E)serialize_selector_list π to_ascii_lowercase π Returns a Cow::Borrowed if s is already ASCII lowercase, and a
Cow::Owned if s had to be converted into ASCII lowercase. try_parse_combinator π OptionalQName π SelectorData π SelectorParseError