style: Correctly style dark scrollbars in tree components.

We need to ensure the rules that override all properties for scrollbar
part elements only apply to those that are NAC (and so will be eligible
for NAC style sharing).  We have some uses of non-NAC <scrollbar>
elements that should continue to inherit properties from their parents.

To avoid any changes in rule matching order that come with changing specificity,
we add a new :-moz-native-anonymous-no-specificity pseudo-class.

While we're here, we note :-moz-native-anonymous-no-specificity (and the
regular :-moz-native-anonymous pseudo-class) as not needing style
sharing cache revalidation, as we never share NAC styles.

Differential Revision: https://phabricator.services.mozilla.com/D56154
This commit is contained in:
Cameron McCormack 2019-12-09 03:16:03 +00:00 committed by Emilio Cobos Álvarez
parent e944962fe2
commit 6973317a58
6 changed files with 31 additions and 4 deletions

View file

@ -17,7 +17,7 @@
//! is non-trivial. This module encapsulates those details and presents an
//! easy-to-use API for the parser.
use crate::parser::{Combinator, Component, SelectorImpl};
use crate::parser::{Combinator, Component, NonTSPseudoClass, SelectorImpl};
use crate::sink::Push;
use servo_arc::{Arc, HeaderWithLength, ThinArc};
use smallvec::{self, SmallVec};
@ -322,9 +322,13 @@ where
Component::NthLastOfType(..) |
Component::FirstOfType |
Component::LastOfType |
Component::OnlyOfType |
Component::NonTSPseudoClass(..) => {
Component::OnlyOfType => {
specificity.class_like_selectors += 1;
}
Component::NonTSPseudoClass(ref pseudo) => {
if !pseudo.has_zero_specificity() {
specificity.class_like_selectors += 1;
}
},
Component::ExplicitUniversalType |
Component::ExplicitAnyNamespace |