Skip to content

Commit

Permalink
:-moz-locale-dir shouldn't be a revalidation selector.
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky committed Jun 18, 2017
1 parent c543327 commit eddca4d
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions components/style/gecko/selector_parser.rs
Expand Up @@ -176,16 +176,29 @@ impl NonTSPseudoClass {

/// Returns true if the given pseudoclass should trigger style sharing cache revalidation.
pub fn needs_cache_revalidation(&self) -> bool {
// :dir() depends on state only, but doesn't use state_flag because its
// semantics don't quite match. Nevertheless, it doesn't need cache
// revalidation, because we already compare states for elements and
// candidates.
self.state_flag().is_empty() &&
!matches!(*self,
// :-moz-any is handled by the revalidation visitor walking
// the things inside it; it does not need to cause
// revalidation on its own.
NonTSPseudoClass::MozAny(_) |
// :dir() depends on state only, but doesn't use state_flag
// because its semantics don't quite match. Nevertheless, it
// doesn't need cache revalidation, because we already compare
// states for elements and candidates.
NonTSPseudoClass::Dir(_) |
// :-moz-is-html only depends on the state of the document and
// the namespace of the element; the former is invariant
// across all the elements involved and the latter is already
// checked for by our caching precondtions.
NonTSPseudoClass::MozIsHTML |
NonTSPseudoClass::MozPlaceholder)
// :-moz-placeholder is parsed but never matches.
NonTSPseudoClass::MozPlaceholder |
// :-moz-locale-dir depends only on the state of the document,
// which is invariant across all the elements involved in a
// given style cache.
NonTSPseudoClass::MozLocaleDir(_)
)
}

/// Convert NonTSPseudoClass to Gecko's CSSPseudoClassType.
Expand Down

0 comments on commit eddca4d

Please sign in to comment.