style: Make the MatchingMode in MatchingContext private.

It used to be the case that MatchingContext was immutable and thus we didn't
care to have accessors.

This is no longer true, so let's make this code a bit nicer.
This commit is contained in:
Emilio Cobos Álvarez 2018-01-20 02:26:59 +01:00
parent bccb757bcd
commit c384c21cb6
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 9 additions and 3 deletions

View file

@ -285,7 +285,7 @@ where
{
// If this is the special pseudo-element mode, consume the ::pseudo-element
// before proceeding, since the caller has already handled that part.
if context.matching_mode == MatchingMode::ForStatelessPseudoElement &&
if context.matching_mode() == MatchingMode::ForStatelessPseudoElement &&
!context.is_nested() {
// Consume the pseudo.
match *iter.next().unwrap() {
@ -349,7 +349,7 @@ fn matches_hover_and_active_quirk<Impl: SelectorImpl>(
// This compound selector had a pseudo-element to the right that we
// intentionally skipped.
if rightmost == Rightmost::Yes &&
context.matching_mode == MatchingMode::ForStatelessPseudoElement {
context.matching_mode() == MatchingMode::ForStatelessPseudoElement {
return MatchesHoverAndActiveQuirk::No;
}