Skip to content

Commit 3cf8c19

Browse files
emilioLoirooriol
authored andcommitted
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). * w3c/csswg-drafts#6285 * whatwg/compat#144 Differential Revision: https://phabricator.services.mozilla.com/D114912
1 parent 032cf64 commit 3cf8c19

File tree

1 file changed

+8
-1
lines changed
  • components/style/values/specified

1 file changed

+8
-1
lines changed

components/style/values/specified/image.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,14 @@ impl ImageSet {
365365
cors_mode: CorsMode,
366366
only_url: bool,
367367
) -> Result<Self, ParseError<'i>> {
368-
input.expect_function_matching("image-set")?;
368+
let function = input.expect_function()?;
369+
match_ignore_ascii_case! { &function,
370+
"-webkit-image-set" | "image-set" => {},
371+
_ => {
372+
let func = function.clone();
373+
return Err(input.new_custom_error(StyleParseErrorKind::UnexpectedFunction(func)));
374+
}
375+
}
369376
let items = input.parse_nested_block(|input| {
370377
input.parse_comma_separated(|input| ImageSetItem::parse(context, input, cors_mode, only_url))
371378
})?;

0 commit comments

Comments
 (0)