mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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
This commit is contained in:
parent
032cf64d1b
commit
3cf8c19313
1 changed files with 8 additions and 1 deletions
|
@ -365,7 +365,14 @@ impl ImageSet {
|
|||
cors_mode: CorsMode,
|
||||
only_url: bool,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
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))
|
||||
})?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue