mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Remove layout.css.moz-any-is-is.enabled.
We shipped this, let's remove the MozAny code. Differential Revision: https://phabricator.services.mozilla.com/D99607
This commit is contained in:
parent
72a0dbacc7
commit
a3f84f85e3
3 changed files with 5 additions and 69 deletions
|
@ -14,13 +14,10 @@ use crate::string_cache::{Atom, Namespace, WeakAtom, WeakNamespace};
|
|||
use crate::values::{AtomIdent, AtomString};
|
||||
use cssparser::{BasicParseError, BasicParseErrorKind, Parser};
|
||||
use cssparser::{CowRcStr, SourceLocation, ToCss, Token};
|
||||
use selectors::parser::{SelectorParseErrorKind, ParseErrorRecovery};
|
||||
use selectors::parser::{self as selector_parser, Selector};
|
||||
use selectors::visitor::SelectorVisitor;
|
||||
use selectors::parser::{ParseErrorRecovery, SelectorParseErrorKind};
|
||||
use selectors::SelectorList;
|
||||
use std::fmt;
|
||||
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss as ToCss_};
|
||||
use thin_slice::ThinBoxedSlice;
|
||||
|
||||
pub use crate::gecko::pseudo_element::{
|
||||
PseudoElement, EAGER_PSEUDOS, EAGER_PSEUDO_COUNT, PSEUDO_COUNT,
|
||||
|
@ -54,11 +51,6 @@ macro_rules! pseudo_class_name {
|
|||
Lang(Lang),
|
||||
/// The `:dir` pseudo-class.
|
||||
Dir(Direction),
|
||||
/// The non-standard `:-moz-any` pseudo-class.
|
||||
///
|
||||
/// TODO(emilio): We disallow combinators and pseudos here, so we
|
||||
/// should use SimpleSelector instead
|
||||
MozAny(ThinBoxedSlice<Selector<SelectorImpl>>),
|
||||
/// The non-standard `:-moz-locale-dir` pseudo-class.
|
||||
MozLocaleDir(Direction),
|
||||
}
|
||||
|
@ -90,17 +82,6 @@ impl ToCss for NonTSPseudoClass {
|
|||
dir.to_css(&mut CssWriter::new(dest))?;
|
||||
return dest.write_char(')')
|
||||
},
|
||||
NonTSPseudoClass::MozAny(ref selectors) => {
|
||||
dest.write_str(":-moz-any(")?;
|
||||
let mut iter = selectors.iter();
|
||||
let first = iter.next().expect(":-moz-any must have at least 1 selector");
|
||||
first.to_css(dest)?;
|
||||
for selector in iter {
|
||||
dest.write_str(", ")?;
|
||||
selector.to_css(dest)?;
|
||||
}
|
||||
return dest.write_char(')')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -145,8 +126,7 @@ impl NonTSPseudoClass {
|
|||
$(NonTSPseudoClass::$name => check_flag!($flags),)*
|
||||
NonTSPseudoClass::MozLocaleDir(_) |
|
||||
NonTSPseudoClass::Lang(_) |
|
||||
NonTSPseudoClass::Dir(_) |
|
||||
NonTSPseudoClass::MozAny(_) => false,
|
||||
NonTSPseudoClass::Dir(_) => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -181,8 +161,7 @@ impl NonTSPseudoClass {
|
|||
$(NonTSPseudoClass::$name => flag!($state),)*
|
||||
NonTSPseudoClass::Dir(..) |
|
||||
NonTSPseudoClass::MozLocaleDir(..) |
|
||||
NonTSPseudoClass::Lang(..) |
|
||||
NonTSPseudoClass::MozAny(..) => ElementState::empty(),
|
||||
NonTSPseudoClass::Lang(..) => ElementState::empty(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -202,12 +181,7 @@ impl NonTSPseudoClass {
|
|||
/// revalidation.
|
||||
pub fn needs_cache_revalidation(&self) -> bool {
|
||||
self.state_flag().is_empty() &&
|
||||
!matches!(
|
||||
*self,
|
||||
// :-moz-any is handled by the revalidation visitor walking
|
||||
// the things inside it; it does not need to cause
|
||||
// revalidation on its own.
|
||||
NonTSPseudoClass::MozAny(_) |
|
||||
!matches!(*self,
|
||||
// :dir() depends on state only, but doesn't use state_flag
|
||||
// because its semantics don't quite match. Nevertheless, it
|
||||
// doesn't need cache revalidation, because we already compare
|
||||
|
@ -251,21 +225,6 @@ impl ::selectors::parser::NonTSPseudoClass for NonTSPseudoClass {
|
|||
NonTSPseudoClass::Hover | NonTSPseudoClass::Active | NonTSPseudoClass::Focus
|
||||
)
|
||||
}
|
||||
|
||||
fn visit<V>(&self, visitor: &mut V) -> bool
|
||||
where
|
||||
V: SelectorVisitor<Impl = Self::Impl>,
|
||||
{
|
||||
if let NonTSPseudoClass::MozAny(ref selectors) = *self {
|
||||
for selector in selectors.iter() {
|
||||
if !selector.visit(visitor) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
/// The dummy struct we use to implement our selector parsing.
|
||||
|
@ -359,8 +318,7 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> {
|
|||
|
||||
#[inline]
|
||||
fn is_is_alias(&self, function: &str) -> bool {
|
||||
static_prefs::pref!("layout.css.moz-any-is-is.enabled") &&
|
||||
function.eq_ignore_ascii_case("-moz-any")
|
||||
function.eq_ignore_ascii_case("-moz-any")
|
||||
}
|
||||
|
||||
fn parse_non_ts_pseudo_class(
|
||||
|
@ -396,14 +354,6 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> {
|
|||
"dir" => {
|
||||
NonTSPseudoClass::Dir(Direction::parse(parser)?)
|
||||
},
|
||||
"-moz-any" => {
|
||||
NonTSPseudoClass::MozAny(
|
||||
selector_parser::parse_compound_selector_list(
|
||||
self,
|
||||
parser,
|
||||
)?.into()
|
||||
)
|
||||
},
|
||||
_ => return Err(parser.new_custom_error(
|
||||
SelectorParseErrorKind::UnsupportedPseudoClassOrElement(name.clone())
|
||||
))
|
||||
|
|
|
@ -2136,10 +2136,6 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
|
|||
self.document_state().contains(state_bit)
|
||||
},
|
||||
NonTSPseudoClass::MozPlaceholder => false,
|
||||
NonTSPseudoClass::MozAny(ref sels) => context.nest(|context| {
|
||||
sels.iter()
|
||||
.any(|s| matches_complex_selector(s.iter(), self, context, flags_setter))
|
||||
}),
|
||||
NonTSPseudoClass::Lang(ref lang_arg) => self.match_element_lang(None, lang_arg),
|
||||
NonTSPseudoClass::MozLocaleDir(ref dir) => {
|
||||
let state_bit = DocumentState::NS_DOCUMENT_STATE_RTL_LOCALE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue