aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/style/gecko/selector_parser.rs23
1 files changed, 18 insertions, 5 deletions
diff --git a/components/style/gecko/selector_parser.rs b/components/style/gecko/selector_parser.rs
index 334ba15197f..c9bd6c7edbb 100644
--- a/components/style/gecko/selector_parser.rs
+++ b/components/style/gecko/selector_parser.rs
@@ -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.