Enum css::selectors::matching::RelevantLinkStatus
[−]
[src]
pub enum RelevantLinkStatus { Looking, NotLooking, Found, }
Tracks whether we are currently looking for relevant links for a given complex selector. A "relevant link" is the element being matched if it is a link or the nearest ancestor link.
matches_complex_selector
creates a new instance of this for each complex
selector we try to match for an element. This is done because is_visited
and is_unvisited
are based on relevant link state of only the current
complex selector being matched (not the global relevant link status for all
selectors in MatchingContext
).
Variants
Looking
Looking for a possible relevant link. This is the initial mode when matching a selector.
NotLooking
Not looking for a relevant link. We transition to this mode if we encounter a sibiling combinator (since only ancestor combinators are allowed for this purpose).
Found
Found a relevant link for the element being matched.
Methods
impl RelevantLinkStatus
[src]
fn is_visited<E>(&self, element: &E, context: &MatchingContext) -> bool where
E: Element,
[src]
E: Element,
Returns whether an element is considered visited for the purposes of matching. This is true only if the element is a link, an relevant link exists for the element, and the visited handling mode is set to accept relevant links as visited.
fn is_unvisited<E>(&self, element: &E, context: &MatchingContext) -> bool where
E: Element,
[src]
E: Element,
Returns whether an element is considered unvisited for the purposes of matching. Assuming the element is a link, this is always true for non-relevant links, since only relevant links can potentially be treated as visited. If this is a relevant link, then is it unvisited if the visited handling mode is set to treat all links as unvisted (including relevant links).
Trait Implementations
impl Clone for RelevantLinkStatus
[src]
fn clone(&self) -> RelevantLinkStatus
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for RelevantLinkStatus
[src]
impl Debug for RelevantLinkStatus
[src]
impl Eq for RelevantLinkStatus
[src]
impl PartialEq for RelevantLinkStatus
[src]
fn eq(&self, __arg_0: &RelevantLinkStatus) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.