style: Remove layout.css.is-and-where-better-error-recovery.enabled

We shipped this in 84

Differential Revision: https://phabricator.services.mozilla.com/D123623
This commit is contained in:
Emilio Cobos Álvarez 2023-05-22 15:06:59 +02:00 committed by Oriol Brufau
parent fa840e1666
commit 55d0636fe5
2 changed files with 5 additions and 23 deletions

View file

@ -256,11 +256,6 @@ pub trait Parser<'i> {
false false
} }
/// The error recovery that selector lists inside :is() and :where() have.
fn is_and_where_error_recovery(&self) -> ParseErrorRecovery {
ParseErrorRecovery::IgnoreInvalidSelector
}
/// Whether the given function name is an alias for the `:is()` function. /// Whether the given function name is an alias for the `:is()` function.
fn is_is_alias(&self, _name: &str) -> bool { fn is_is_alias(&self, _name: &str) -> bool {
false false
@ -344,7 +339,7 @@ pub struct SelectorList<Impl: SelectorImpl>(
); );
/// How to treat invalid selectors in a selector list. /// How to treat invalid selectors in a selector list.
pub enum ParseErrorRecovery { enum ParseErrorRecovery {
/// Discard the entire selector list, this is the default behavior for /// Discard the entire selector list, this is the default behavior for
/// almost all of CSS. /// almost all of CSS.
DiscardList, DiscardList,
@ -2277,7 +2272,7 @@ where
state | state |
SelectorParsingState::SKIP_DEFAULT_NAMESPACE | SelectorParsingState::SKIP_DEFAULT_NAMESPACE |
SelectorParsingState::DISALLOW_PSEUDOS, SelectorParsingState::DISALLOW_PSEUDOS,
parser.is_and_where_error_recovery(), ParseErrorRecovery::IgnoreInvalidSelector,
)?; )?;
Ok(component(inner.0.into_vec().into_boxed_slice())) Ok(component(inner.0.into_vec().into_boxed_slice()))
} }
@ -2686,10 +2681,6 @@ pub mod tests {
true true
} }
fn is_and_where_error_recovery(&self) -> ParseErrorRecovery {
ParseErrorRecovery::DiscardList
}
fn parse_part(&self) -> bool { fn parse_part(&self) -> bool {
true true
} }
@ -3294,9 +3285,9 @@ pub mod tests {
assert!(parse("::slotted(div)::before").is_ok()); assert!(parse("::slotted(div)::before").is_ok());
assert!(parse("slot::slotted(div,foo)").is_err()); assert!(parse("slot::slotted(div,foo)").is_err());
assert!(parse("foo:where()").is_err()); assert!(parse("foo:where()").is_ok());
assert!(parse("foo:where(div, foo, .bar baz)").is_ok()); assert!(parse("foo:where(div, foo, .bar baz)").is_ok());
assert!(parse("foo:where(::before)").is_err()); assert!(parse_expected("foo:where(::before)", Some("foo:where()")).is_ok());
} }
#[test] #[test]

View file

@ -14,7 +14,7 @@ use crate::string_cache::{Atom, Namespace, WeakAtom, WeakNamespace};
use crate::values::{AtomIdent, AtomString}; use crate::values::{AtomIdent, AtomString};
use cssparser::{BasicParseError, BasicParseErrorKind, Parser}; use cssparser::{BasicParseError, BasicParseErrorKind, Parser};
use cssparser::{CowRcStr, SourceLocation, ToCss, Token}; use cssparser::{CowRcStr, SourceLocation, ToCss, Token};
use selectors::parser::{ParseErrorRecovery, SelectorParseErrorKind}; use selectors::parser::SelectorParseErrorKind;
use selectors::SelectorList; use selectors::SelectorList;
use std::fmt; use std::fmt;
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss as ToCss_}; use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss as ToCss_};
@ -311,15 +311,6 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> {
true true
} }
#[inline]
fn is_and_where_error_recovery(&self) -> ParseErrorRecovery {
if static_prefs::pref!("layout.css.is-and-where-better-error-recovery.enabled") {
ParseErrorRecovery::IgnoreInvalidSelector
} else {
ParseErrorRecovery::DiscardList
}
}
#[inline] #[inline]
fn parse_part(&self) -> bool { fn parse_part(&self) -> bool {
true true