diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2022-09-06 17:00:33 +0000 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-11-03 08:59:49 +0100 |
commit | 9f6341b83a088e7062f7915e113acd2bd512162e (patch) | |
tree | b4eef8a9b55680734f01263d8417fde756150022 /components/style/gecko/selector_parser.rs | |
parent | ab36c8a39bba7e21e77d93da94ef5a21bfe3e122 (diff) | |
download | servo-9f6341b83a088e7062f7915e113acd2bd512162e.tar.gz servo-9f6341b83a088e7062f7915e113acd2bd512162e.zip |
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
Diffstat (limited to 'components/style/gecko/selector_parser.rs')
-rw-r--r-- | components/style/gecko/selector_parser.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/components/style/gecko/selector_parser.rs b/components/style/gecko/selector_parser.rs index aee0ce7fe35..6c975862f19 100644 --- a/components/style/gecko/selector_parser.rs +++ b/components/style/gecko/selector_parser.rs @@ -320,6 +320,11 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> { function.eq_ignore_ascii_case("-moz-any") } + #[inline] + fn allow_forgiving_selectors(&self) -> bool { + !self.for_supports_rule + } + fn parse_non_ts_pseudo_class( &self, location: SourceLocation, @@ -373,7 +378,8 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> { location: SourceLocation, name: CowRcStr<'i>, ) -> Result<PseudoElement, ParseError<'i>> { - if let Some(pseudo) = PseudoElement::from_slice(&name) { + let allow_unkown_webkit = !self.for_supports_rule; + if let Some(pseudo) = PseudoElement::from_slice(&name, allow_unkown_webkit) { if self.is_pseudo_element_enabled(&pseudo) { return Ok(pseudo); } |