style: Introduce InspectorUtils.supports().

Which allows to run CSS.supports in chrome/user-agent context. We should
probably add a couple more tweaks for stuff like quirks or what not (the
`ParsingMode` enum), but that seem lower priority.

I only added the one-value version of CSS.supports because it should be enough
and supporting the two value version required a bit of awkward code due to when
we parse the CSS property name right now.

Differential Revision: https://phabricator.services.mozilla.com/D92585
This commit is contained in:
Emilio Cobos Álvarez 2020-10-09 03:20:34 +00:00
parent 2b55918be6
commit 436632f378
2 changed files with 2 additions and 22 deletions

View file

@ -1288,6 +1288,7 @@ pub fn parse_one_declaration_into(
declarations: &mut SourcePropertyDeclaration,
id: PropertyId,
input: &str,
origin: Origin,
url_data: &UrlExtraData,
error_reporter: Option<&dyn ParseErrorReporter>,
parsing_mode: ParsingMode,
@ -1295,7 +1296,7 @@ pub fn parse_one_declaration_into(
rule_type: CssRuleType,
) -> Result<(), ()> {
let context = ParserContext::new(
Origin::Author,
origin,
url_data,
Some(rule_type),
parsing_mode,