Struct selectors::context::MatchingContext [] [src]

pub struct MatchingContext<'a, Impl> where
    Impl: SelectorImpl
{ pub matching_mode: MatchingMode, pub bloom_filter: Option<&'a BloomFilter>, pub nth_index_cache: Option<&'a mut NthIndexCache>, pub visited_handling: VisitedHandlingMode, pub scope_element: Option<OpaqueElement>, pub nesting_level: usize, pub pseudo_element_matching_fn: Option<&'a Fn(&Impl::PseudoElement) -> bool>, pub extra_data: Impl::ExtraMatchingData, // some fields omitted }

Data associated with the matching process for a element. This context is used across many selectors for an element, so it's not appropriate for transient data that applies to only a single selector.

Fields

Input with the matching mode we should use when matching selectors.

Input with the bloom filter used to fast-reject selectors.

An optional cache to speed up nth-index-like selectors.

Input that controls how matching for links is handled.

The element which is going to match :scope pseudo-class. It can be either one :scope element, or the scoping element.

Note that, although in theory there can be multiple :scope elements, in current specs, at most one is specified, and when there is one, scoping element is not relevant anymore, so we use a single field for them.

When this is None, :scope will match the root element.

See https://drafts.csswg.org/selectors-4/#scope-pseudo

The current nesting level of selectors that we're matching.

FIXME(emilio): Move this somewhere else and make MatchingContext immutable again.

An optional hook function for checking whether a pseudo-element should match when matching_mode is ForStatelessPseudoElement.

Extra implementation-dependent matching data.

Methods

impl<'a, Impl> MatchingContext<'a, Impl> where
    Impl: SelectorImpl
[src]

[src]

Constructs a new MatchingContext.

[src]

Constructs a new MatchingContext for use in visited matching.

[src]

The quirks mode of the document.

[src]

The case-sensitivity for class and ID selectors