diff options
author | Boris Zbarsky <bzbarsky@mit.edu> | 2017-05-15 14:31:53 -0400 |
---|---|---|
committer | Boris Zbarsky <bzbarsky@mit.edu> | 2017-05-16 09:55:37 -0400 |
commit | 993cb6eb41a91959e19db862be011a8bb76277f5 (patch) | |
tree | a52dbaade836d716d4f7658d895102ce8203e5a8 | |
parent | 0388e11db2532d41a71e184cb2a1f46e5107b8f5 (diff) | |
download | servo-993cb6eb41a91959e19db862be011a8bb76277f5.tar.gz servo-993cb6eb41a91959e19db862be011a8bb76277f5.zip |
Don't require style sharing cache invalidation for :dir
-rw-r--r-- | components/style/gecko/selector_parser.rs | 6 |
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. |