From 2d205eed2491b1e4325b6204ceb69cba39ef165c Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Sun, 18 Jun 2017 02:14:22 -0700 Subject: [PATCH] servo: Merge #17386 - :-moz-locale-dir shouldn't be a revalidation selector (from bzbarsky:locale-dir-not-revalidation); r=emilio Fixes Gecko bug 1374019 --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix https://bugzilla.mozilla.org/show_bug.cgi?id=1374019 - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ Source-Repo: https://github.com/servo/servo Source-Revision: 4c5f7bfaa3bfa57b92b1a30f86e4d5e4031d78db --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 0b72e43e6db84e8db0d34410dd0273f9c7590ff3 --- .../components/style/gecko/selector_parser.rs | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/servo/components/style/gecko/selector_parser.rs b/servo/components/style/gecko/selector_parser.rs index 334ba15197ff..c9bd6c7edbbe 100644 --- a/servo/components/style/gecko/selector_parser.rs +++ b/servo/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.