Update web-platform-tests to revision b'e9baa05836ecf60b3aec73de9b55cd7c20952f34'

This commit is contained in:
WPT Sync Bot 2022-12-18 01:50:39 +00:00
parent dae8d221a1
commit bc35487659
139 changed files with 2501 additions and 1291 deletions

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<title>Image set no resolution rendering</title>
<link rel="author" title="Noam Rosenthal" href="mailto:noam@webkit.org">
<link rel="author" title="Traian Captan" href="mailto:tcaptan@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-images-4/#image-set-notation">
<link rel="match" href="reference/image-set-rendering-ref.html">
<meta name="assert" content="image-set rendering with no resolution defined">
<script src="resources/image-set-rendering-helper.js"></script>
<style>
#test {
background-image: image-set(url("/images/green.png"), url("/images/green.png"));
}
</style>

View file

@ -19,6 +19,47 @@ function test_invalid_value_variants(property, value) {
test_invalid_value(property, "-webkit-" + value);
}
function test_default_resolution() {
// Based on the spec, the resolution is optional and should default
// to 1x if not specified.
// This set of tests verify this expectation.
// Test when the only image is missing it's resolution
test_valid_value_variants(
'background-image',
'image-set(url(foo))',
'image-set(url("foo") 1x)'
);
// Test when the 1st of 2 images is missing it's resolution
test_valid_value_variants(
'background-image',
'image-set(url(foo), url(bar) 1x)',
'image-set(url("foo") 1x, url("bar") 1x)'
);
// Test when the 2nd of 2 images is missing it's resolution
test_valid_value_variants(
'background-image',
'image-set(url(foo) 1x, url(bar))',
'image-set(url("foo") 1x, url("bar") 1x)'
);
// Test when both images are missing their resolutions
test_valid_value_variants(
'background-image',
'image-set(url(foo), url(bar))',
'image-set(url("foo") 1x, url("bar") 1x)'
);
// Test when the middle of 3 images is missing it's resolution
test_valid_value_variants(
'background-image',
'image-set(url(foo) 1x, url(bar), url(baz) 2x)',
'image-set(url("foo") 1x, url("bar") 1x, url("baz") 2x)'
);
}
test_valid_value_variants('background-image', "image-set(url(example.png) 1x)", 'image-set(url("example.png") 1x)');
test_valid_value_variants('background-image', 'image-set(url("example.png") 1x)');
test_valid_value_variants('background-image', "image-set('example.jpg' 1x)", 'image-set(url("example.jpg") 1x)');
@ -45,4 +86,6 @@ test_invalid_value_variants('background-image', "image-set(url(example.png) type
test_invalid_value_variants('background-image', "image-set(url(example.png) 1xtype('image/png'))");
test_invalid_value_variants('background-image', "image-set(type('image/png') url(example.png) 1x)");
test_invalid_value_variants('cursor', "image-set(linear-gradient(black, white) 1x)");
test_default_resolution();
</script>