From d5a5a7ff1612ad7ce9cb9f85f0d6e77cd5188756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 29 Jun 2017 08:45:05 -0700 Subject: [PATCH] style: Don't treat some document-state-related pseudo-classes as revalidation selectors. --- components/style/gecko/selector_parser.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/components/style/gecko/selector_parser.rs b/components/style/gecko/selector_parser.rs index 332670c3a76..78ddc05dff4 100644 --- a/components/style/gecko/selector_parser.rs +++ b/components/style/gecko/selector_parser.rs @@ -174,7 +174,8 @@ impl NonTSPseudoClass { apply_non_ts_list!(pseudo_class_state) } - /// Returns true if the given pseudoclass should trigger style sharing cache revalidation. + /// Returns true if the given pseudoclass should trigger style sharing cache + /// revalidation. pub fn needs_cache_revalidation(&self) -> bool { self.state_flag().is_empty() && !matches!(*self, @@ -194,10 +195,15 @@ impl NonTSPseudoClass { NonTSPseudoClass::MozIsHTML | // :-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(_) + // :-moz-locale-dir and :-moz-window-inactive depend only on + // the state of the document, which is invariant across all + // the elements involved in a given style cache. + NonTSPseudoClass::MozLocaleDir(_) | + NonTSPseudoClass::MozWindowInactive | + // Similar for the document themes. + NonTSPseudoClass::MozLWTheme | + NonTSPseudoClass::MozLWThemeBrightText | + NonTSPseudoClass::MozLWThemeDarkText ) }