Skip to content

Commit ef2964b

Browse files
zcorpanmoz-wptsync-bot
authored andcommitted
Bug 1716975 [wpt PR 29411] - Test density size correction for cross-origin images, a=testonly
Automatic update from web-platform-tests Test density size correction for cross-origin images See whatwg/html#5574 -- wpt-commits: 2c19d6ee62676ac90146e7311ba13d8eaeb241fd wpt-pr: 29411
1 parent 41f4851 commit ef2964b

9 files changed

+184
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<html>
2+
<head>
3+
<title>Density Corrected Size: SVG aspect ratio (cross-origin)</title>
4+
<link rel="match" href="density-corrected-image-svg-aspect-ratio-ref.html" />
5+
<meta name="assert" content="Assert that SVG aspect ratio is applied correctly on density-corrected images">
6+
<meta name=fuzzy content="10;100">
7+
</head>
8+
<body>
9+
<svg style="width: 800px; height: 800px">
10+
<image xlink:href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-hires.jpg" x="0" y="0" width="120" height="120" preserveAspectRatio="xMinYMin meet"></image>
11+
<image xlink:href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-lores.jpg" x="200" y="0" width="120" height="120" preserveAspectRatio="xMidYMin meet"></image>
12+
<image xlink:href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-hires.jpg" x="400" y="0" width="120" height="120" preserveAspectRatio="xMaxYMin meet"></image>
13+
<image xlink:href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-non-uniform.jpg" x="600" y="0" width="120" height="120" preserveAspectRatio="xMidYMin meet"></image>
14+
15+
<image xlink:href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-lores.jpg" x="0" y="150" width="120" height="120" preserveAspectRatio="xMinYMid slice"></image>
16+
<image xlink:href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-hires.jpg" x="200" y="150" width="120" height="120" preserveAspectRatio="xMidYMid slice"></image>
17+
<image xlink:href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-lores.jpg" x="400" y="150" width="120" height="120" preserveAspectRatio="xMaxYMid slice"></image>
18+
<image xlink:href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-non-uniform.jpg" x="600" y="150" width="120" height="120" preserveAspectRatio="xMinYMid slice"></image>
19+
20+
<image xlink:href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-hires.jpg" x="200" y="300" width="120" height="120" preserveAspectRatio="xMidYMax meet"></image>
21+
<image xlink:href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-lores.jpg" x="400" y="300" width="120" height="120" preserveAspectRatio="xMaxYMax meet"></image>
22+
<image xlink:href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-non-uniform.jpg" x="600" y="300" width="120" height="120" preserveAspectRatio="xMaxYMid slice"></image>
23+
24+
<image xlink:href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-hires.jpg" x="0" y="450" width="120" height="120" preserveAspectRatio="none"></image>
25+
<image xlink:href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-lores.jpg" x="200" y="450" width="120" height="120" preserveAspectRatio="none"></image>
26+
<image xlink:href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-non-uniform.jpg" x="400" y="450" width="120" height="120" preserveAspectRatio="none"></image>
27+
<image xlink:href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-non-uniform.jpg" x="600" y="450" width="120" height="120" preserveAspectRatio="xMaxYMax meet"></image>
28+
</svg>
29+
</div>
30+
</body>
31+
</html>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<html>
2+
<head>
3+
<title>Density Corrected Size: SVG (cross-origin)</title>
4+
<link rel="match" href="density-corrected-image-svg-ref.html" />
5+
<meta name="assert" content="Assert that density-corrected size in EXIF is taken into account for SVG <image>">
6+
</head>
7+
<body>
8+
<svg width="200" height="200">
9+
<image href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-none.jpg" />
10+
</svg>
11+
<svg width="200" height="200">
12+
<image href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-hires.jpg" />
13+
</svg>
14+
<svg width="200" height="200">
15+
<image href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-lores.jpg" />
16+
</svg>
17+
<svg width="200" height="200">
18+
<image href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-non-uniform.jpg" />
19+
</svg>
20+
<svg width="200" height="200">
21+
<image href="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-with-orientation.jpg" />
22+
</svg>
23+
</div>
24+
</body>
25+
</html>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<head>
3+
<title>Density corrected size: background images (cross-origin)</title>
4+
<link rel="match" href="density-corrected-size-bg-ref.html" />
5+
<meta name="assert" content="Assert that background images with EXIF density-corrected-size are rendered correctly">
6+
</head>
7+
<body>
8+
<style>
9+
body {
10+
--lores: url(http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-lores.jpg);
11+
--hires: url(http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-hires.jpg);
12+
--default: url(http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-none.jpg);
13+
--non-uniform: url(http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-non-uniform.jpg);
14+
}
15+
.default-bg {background-image: var(--default); }
16+
.lores-bg {background-image: var(--lores); }
17+
.hires-bg {background-image: var(--hires); }
18+
.invalid-bg {background-image: var(--invalid); }
19+
.non-uniform-bg {background-image: var(--non-uniform); }
20+
.box { width: 200px; height: 200px; display: inline-block; }
21+
.tiled {background-repeat: repeat; }
22+
.stretch {background-repeat: no-repeat; background-size: contain; }
23+
</style>
24+
<div class="default-bg tiled box"></div>
25+
<div class="lores-bg tiled box"></div>
26+
<div class="hires-bg tiled box"></div>
27+
<div class="non-uniform-bg tiled box"></div>
28+
<br/>
29+
<div class="lores-bg stretch box"></div>
30+
<div class="default-bg stretch box"></div>
31+
<div class="non-uniform-bg stretch box"></div>
32+
</body>
33+
</html>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<head>
3+
<title>Density corrected size: rendering</title>
4+
<link rel="match" href="density-corrected-size-img-ref.html" />
5+
<meta name="assert" content="Assert that images with EXIF density-corrected-size are rendered correctly">
6+
</head>
7+
<body>
8+
<img src="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-none.jpg" />
9+
<img src="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-hires.jpg" />
10+
<img src="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-lores.jpg" />
11+
<img src="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-non-uniform.jpg" />
12+
</body>
13+
</html>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<head>
3+
<title>Density corrected size: pseudo-elements (cross-origin)</title>
4+
<link rel="match" href="density-corrected-size-pseudo-elements-ref.html" />
5+
<meta name="assert" content="Assert that images with EXIF density-corrected-size are rendered correctly when in a pseudo element">
6+
</head>
7+
<body>
8+
<style>
9+
body {
10+
--lores: url(http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-lores.jpg);
11+
--default: url(http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-none.jpg);
12+
}
13+
.lores-after::after {content: var(--lores); }
14+
.default-after::after {content: var(--default); }
15+
</style>
16+
<div class="lores-after box"></div>
17+
<div class="default-after box"></div>
18+
</body>
19+
</html>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<html>
2+
<head>
3+
<title>Density Corrected Size: various elements (cross-origin)</title>
4+
<link rel="match" href="density-corrected-various-elements-ref.html" />
5+
<meta name="assert" content="Assert that density-corrected size in EXIF is taken into account for images in all relevant elements (input/video-poster)">
6+
<style>
7+
.row {
8+
display: flex;
9+
}
10+
11+
.row > * {
12+
object-fit: none;
13+
object-position: top left;
14+
margin: 5px;
15+
width: 100px;
16+
height: 50px;
17+
background: #CCCCCC;
18+
}
19+
</style>
20+
</head>
21+
<body>
22+
<p>There following boxes should be identical (the colorful boxes at the top-left quarter)</p>
23+
<div class="row">
24+
<div>
25+
<img src="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-none.jpg" width="50" height="25" />
26+
</div>
27+
<video poster="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-hires.jpg"></video>
28+
<div>
29+
<input type="image" src="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-hires.jpg" />
30+
</div>
31+
</div>
32+
</body>
33+
</html>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<link rel="match" href="image-set-001-ref.html">
3+
<style>
4+
body { margin: 0 }
5+
div {
6+
width: 100vw;
7+
height: 100vh;
8+
background-image: -webkit-image-set(url(http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-hires.jpg) 1x);
9+
background-image: image-set(url(http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-hires.jpg) 1x);
10+
background-repeat: no-repeat;
11+
}
12+
</style>
13+
<div></div>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<link rel="match" href="image-set-002-ref.html">
3+
<style>
4+
body { margin: 0 }
5+
div {
6+
width: 100vw;
7+
height: 100vh;
8+
background-image: -webkit-image-set(url(http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-hires.jpg) 0.5x);
9+
background-image: image-set(url(http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-hires.jpg) 0.5x);
10+
background-repeat: no-repeat;
11+
}
12+
</style>
13+
<div></div>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!doctype html>
2+
<link rel="match" href="srcset-ref.html">
3+
<img srcset="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-hires.jpg 1x">
4+
<img srcset="http://{{hosts[alt][]}}:{{ports[http][0]}}/density-size-correction/resources/exif-resolution-valid-hires.jpg 0.5x">

0 commit comments

Comments
 (0)