Auto merge of #17562 - emilio:less-revalidation-stuff, r=bzbarsky

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

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17562)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-01 08:13:58 -07:00 committed by GitHub
commit be58b99b06

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