Update web-platform-tests to revision b'2703c75d5e889bb7c6a918de44841bf9de8d63a7'

This commit is contained in:
WPT Sync Bot 2023-03-25 01:51:50 +00:00
parent d8e886a792
commit 7bf23c63b3
338 changed files with 9438 additions and 933 deletions

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<title>Image set calc x rendering</title>
<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 calc x rendering">
<style>
#test {
background-image: image-set(
url("/images/green.png") calc(0.5x * 2),
url("/images/red.png") 2x
);
width: 100px;
height: 100px;
}
</style>
<div id="test"></div>

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<title>Image set calc x rendering</title>
<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 calc x rendering">
<style>
#test {
background-image: image-set(url("/images/green.png") calc(0.5x * 2));
width: 100px;
height: 100px;
}
</style>
<div id="test"></div>

View file

@ -16,6 +16,32 @@ function test_computed_value_variants(property, specified, computed) {
test_computed_value(property, "-webkit-" + specified, computed);
}
function test_calculated_resolution_units() {
test_computed_value_variants(
'background-image',
"image-set(url('http://{{host}}/example.png') calc(1x * 2))",
'image-set(url("http://{{host}}/example.png") 2dppx)'
);
test_computed_value_variants(
'background-image',
"image-set(url('http://{{host}}/example.png') calc(6dppx / 3))",
'image-set(url("http://{{host}}/example.png") 2dppx)'
);
test_computed_value_variants(
'background-image',
"image-set(url('http://{{host}}/example.png') calc(100dpi - 4dpi))",
'image-set(url("http://{{host}}/example.png") 1dppx)'
);
test_computed_value_variants(
'background-image',
"image-set(url('http://{{host}}/example.png') calc(37dpcm + 0.79532dpcm))",
'image-set(url("http://{{host}}/example.png") 1dppx)'
);
}
// The resolution unit is expected to be converted to the canonical unit 'dppx'
// for computed style.
test_computed_value_variants('background-image', "image-set(url(http://{{host}}/example.png) 1x)", 'image-set(url("http://{{host}}/example.png") 1dppx)');
@ -33,4 +59,6 @@ test_computed_value_variants('content', "image-set(url('http://{{host}}/example.
// Unsupported type should still serialize.
test_computed_value_variants('background-image', 'image-set(url("http://{{host}}/example.png") type("image/unsupported"))', 'image-set(url("http://{{host}}/example.png") 1dppx type("image/unsupported"))');
test_computed_value_variants('background-image', 'image-set(url("http://{{host}}/example.png") 2x type("image/unsupported"), url("http://{{host}}/example.png") 1x type("image/unsupported"))', 'image-set(url("http://{{host}}/example.png") 2dppx type("image/unsupported"), url("http://{{host}}/example.png") 1dppx type("image/unsupported"))');
test_calculated_resolution_units();
</script>