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:
Emilio Cobos Álvarez 2022-09-06 17:00:33 +00:00 committed by Martin Robinson
parent ab36c8a39b
commit 9f6341b83a
6 changed files with 25 additions and 23 deletions

View file

@ -47,6 +47,8 @@ pub struct SelectorParser<'a> {
/// The extra URL data of the stylesheet, which is used to look up
/// whether we are parsing a chrome:// URL style sheet.
pub url_data: &'a UrlExtraData,
/// Whether we're parsing selectors for `@supports`
pub for_supports_rule: bool,
}
impl<'a> SelectorParser<'a> {
@ -63,6 +65,7 @@ impl<'a> SelectorParser<'a> {
stylesheet_origin: Origin::Author,
namespaces: &namespaces,
url_data,
for_supports_rule: false,
};
let mut input = ParserInput::new(input);
SelectorList::parse(&parser, &mut CssParser::new(&mut input))