mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
style: Disallow forgiving selector-parsing in @supports
As per spec, see https://github.com/w3c/csswg-drafts/issues/7280 Differential Revision: https://phabricator.services.mozilla.com/D156468
This commit is contained in:
parent
ab36c8a39b
commit
9f6341b83a
6 changed files with 25 additions and 23 deletions
|
@ -276,6 +276,11 @@ pub trait Parser<'i> {
|
|||
false
|
||||
}
|
||||
|
||||
/// Whether to allow forgiving selector-list parsing.
|
||||
fn allow_forgiving_selectors(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
/// Parses non-tree-structural pseudo-classes. Tree structural pseudo-classes,
|
||||
/// like `:first-child`, are built into this library.
|
||||
///
|
||||
|
@ -400,7 +405,11 @@ impl<Impl: SelectorImpl> SelectorList<Impl> {
|
|||
Ok(selector) => values.push(selector),
|
||||
Err(err) => match recovery {
|
||||
ParseErrorRecovery::DiscardList => return Err(err),
|
||||
ParseErrorRecovery::IgnoreInvalidSelector => {},
|
||||
ParseErrorRecovery::IgnoreInvalidSelector => {
|
||||
if !parser.allow_forgiving_selectors() {
|
||||
return Err(err);
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue