aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/style/gecko/selector_parser.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/components/style/gecko/selector_parser.rs b/components/style/gecko/selector_parser.rs
index bed3737db99..e46b8c489f5 100644
--- a/components/style/gecko/selector_parser.rs
+++ b/components/style/gecko/selector_parser.rs
@@ -159,8 +159,12 @@ 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, NonTSPseudoClass::MozAny(_))
+ !matches!(*self, NonTSPseudoClass::MozAny(_) | NonTSPseudoClass::Dir(_))
}
/// Convert NonTSPseudoClass to Gecko's CSSPseudoClassType.