style: Replace :-moz-native-anonymous-no-specificity with :where(:-moz-native-anonymous).

Differential Revision: https://phabricator.services.mozilla.com/D88255
This commit is contained in:
Masatoshi Kimura 2020-08-26 11:45:35 +00:00 committed by Emilio Cobos Álvarez
parent 9ce200a924
commit 639bada63a
2 changed files with 3 additions and 15 deletions

View file

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

View file

@ -53,9 +53,6 @@ pub trait NonTSPseudoClass: Sized + ToCss {
/// https://drafts.csswg.org/selectors-4/#useraction-pseudos /// https://drafts.csswg.org/selectors-4/#useraction-pseudos
fn is_user_action_state(&self) -> bool; fn is_user_action_state(&self) -> bool;
/// Whether this pseudo-class has zero specificity.
fn has_zero_specificity(&self) -> bool;
fn visit<V>(&self, _visitor: &mut V) -> bool fn visit<V>(&self, _visitor: &mut V) -> bool
where where
V: SelectorVisitor<Impl = Self::Impl>, V: SelectorVisitor<Impl = Self::Impl>,
@ -2564,11 +2561,6 @@ pub mod tests {
fn is_user_action_state(&self) -> bool { fn is_user_action_state(&self) -> bool {
self.is_active_or_hover() self.is_active_or_hover()
} }
#[inline]
fn has_zero_specificity(&self) -> bool {
false
}
} }
impl ToCss for PseudoClass { impl ToCss for PseudoClass {