aboutsummaryrefslogtreecommitdiffstats
path: root/components/selectors/parser.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2023-05-22 15:06:59 +0200
committerOriol Brufau <obrufau@igalia.com>2023-05-24 18:32:43 +0200
commit55d0636fe5dc1d726a6917349b01ceeaf9794ebb (patch)
tree32322762c823588afac59472b84d2f3ba06bfddc /components/selectors/parser.rs
parentfa840e166636d1f4529ac8dbaef6fa326d07289b (diff)
downloadservo-55d0636fe5dc1d726a6917349b01ceeaf9794ebb.tar.gz
servo-55d0636fe5dc1d726a6917349b01ceeaf9794ebb.zip
style: Remove layout.css.is-and-where-better-error-recovery.enabled
We shipped this in 84 Differential Revision: https://phabricator.services.mozilla.com/D123623
Diffstat (limited to 'components/selectors/parser.rs')
-rw-r--r--components/selectors/parser.rs17
1 files changed, 4 insertions, 13 deletions
diff --git a/components/selectors/parser.rs b/components/selectors/parser.rs
index 0b8d7d2331e..c6650102616 100644
--- a/components/selectors/parser.rs
+++ b/components/selectors/parser.rs
@@ -256,11 +256,6 @@ pub trait Parser<'i> {
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.
fn is_is_alias(&self, _name: &str) -> bool {
false
@@ -344,7 +339,7 @@ pub struct SelectorList<Impl: SelectorImpl>(
);
/// 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
/// almost all of CSS.
DiscardList,
@@ -2277,7 +2272,7 @@ where
state |
SelectorParsingState::SKIP_DEFAULT_NAMESPACE |
SelectorParsingState::DISALLOW_PSEUDOS,
- parser.is_and_where_error_recovery(),
+ ParseErrorRecovery::IgnoreInvalidSelector,
)?;
Ok(component(inner.0.into_vec().into_boxed_slice()))
}
@@ -2686,10 +2681,6 @@ pub mod tests {
true
}
- fn is_and_where_error_recovery(&self) -> ParseErrorRecovery {
- ParseErrorRecovery::DiscardList
- }
-
fn parse_part(&self) -> bool {
true
}
@@ -3294,9 +3285,9 @@ pub mod tests {
assert!(parse("::slotted(div)::before").is_ok());
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(::before)").is_err());
+ assert!(parse_expected("foo:where(::before)", Some("foo:where()")).is_ok());
}
#[test]