style: Don't treat some document-state-related pseudo-classes as revalidation selectors.

This commit is contained in:
Emilio Cobos Álvarez 2017-06-29 08:45:05 -07:00
parent 9a13cf6bda
commit d5a5a7ff16
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -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
)
}