From 3cf8c1931378cb1cbd7a0aeebb63af411e0fb04b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 21 May 2023 21:25:19 +0200 Subject: [PATCH] style: Support -webkit-image-set as a parse-time alias to image-set() The webkit syntax is an strict subset of the modern one, so this should be doable, and is the simplest. If my reading of the WebKit code is correct it should also be the way WebKit deals with this (except they restrict -webkit-image-set() syntax artificially). * https://github.com/w3c/csswg-drafts/issues/6285 * https://github.com/whatwg/compat/issues/144 Differential Revision: https://phabricator.services.mozilla.com/D114912 --- components/style/values/specified/image.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/style/values/specified/image.rs b/components/style/values/specified/image.rs index 85c178e064d..dae7fe286d0 100644 --- a/components/style/values/specified/image.rs +++ b/components/style/values/specified/image.rs @@ -365,7 +365,14 @@ impl ImageSet { cors_mode: CorsMode, only_url: bool, ) -> Result> { - input.expect_function_matching("image-set")?; + let function = input.expect_function()?; + match_ignore_ascii_case! { &function, + "-webkit-image-set" | "image-set" => {}, + _ => { + let func = function.clone(); + return Err(input.new_custom_error(StyleParseErrorKind::UnexpectedFunction(func))); + } + } let items = input.parse_nested_block(|input| { input.parse_comma_separated(|input| ImageSetItem::parse(context, input, cors_mode, only_url)) })?;