Content-Length: 453276 | pFad | http://github.com/mozilla/gecko-dev/commit/b679571ac19ecd4bb15d97d1c71aef0396e32897

38 Bug 1820684 [wpt PR 38839] - Add support for non-positive resolutions… · mozilla/gecko-dev@b679571 · GitHub
Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b679571

Browse files
tcaptan-crmoz-wptsync-bot
authored andcommittedMar 29, 2023
Bug 1820684 [wpt PR 38839] - Add support for non-positive resolutions to image-set, a=testonly
Automatic update from web-platform-tests Add support for non-positive resolutions to image-set This change was triggered by the recently added wpt tests that started failing after auto import: third_party/blink/web_tests/external/wpt/css/css-images/image-set/image-set-zero-resolution-rendering.html third_party/blink/web_tests/external/wpt/css/css-images/image-set/image-set-zero-resolution-rendering-2.html Currently the spec does not restrict the range for resolution, thus non-positive resolutions are valid and should not be rejected at parse time. The current consensus is to parse the non-positive resolutions, but treat them as unsupported options for rendering purposes. With this change, image-set will match resolution parsing with media queries. An issue has been opend for the spec to define the valid argument range for resolution: w3c/csswg-drafts#8532 In the discussion on the issue new proposals were added about how to treat zero resolutions for rendering purposes. Until the spec is well defined in this area we will remove the zero resolution rendering tests. R=futhark, pdr Change-Id: I7b329519168f3c088f5c9ee8614931b0ead7a4df Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4312883 Commit-Queue: Philip Rogers <pdr@chromium.org> Commit-Queue: Traian Captan <tcaptan@chromium.org> Reviewed-by: Philip Rogers <pdr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1114116} -- wpt-commits: 6dd9e79912d5161f24b2bf576e0b115c28cde956 wpt-pr: 38839
1 parent 24fd1bb commit b679571

File tree

4 files changed

+55
-20
lines changed

4 files changed

+55
-20
lines changed
 

‎testing/web-platform/tests/css/css-images/image-set/image-set-zero-resolution-rendering-2.html renamed to ‎testing/web-platform/tests/css/css-images/image-set/image-set-negative-resolution-rendering-2.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
<!DOCTYPE html>
2-
<title>Image set invalid resolution rendering</title>
3-
<link rel="author" title="Noam Rosenthal" href="mailto:noam@webkit.org">
2+
<title>Image set negative resolution rendering</title>
43
<link rel="author" title="Traian Captan" href="mailto:tcaptan@chromium.org">
54
<link rel="help" href="https://drafts.csswg.org/css-images-4/#image-set-notation">
65
<link rel="match" href="reference/image-set-rendering-ref.html">
7-
<meta name="assert" content="image-set rendering with zero resolution">
6+
<meta name="assert" content="image-set rendering with negative resolution">
87
<style>
98
#test {
109
background-image: url("/images/red.png");
1110
background-image: image-set(
12-
url("/images/green.png") 0x,
11+
url("/images/red.png") -1x,
1312
url("/images/green.png") 2x
1413
);
1514
width: 100px;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<title>Image set negative resolution rendering</title>
3+
<link rel="author" title="Traian Captan" href="mailto:tcaptan@chromium.org">
4+
<link rel="help" href="https://drafts.csswg.org/css-images-4/#image-set-notation">
5+
<link rel="match" href="/css/reference/blank.html">
6+
<meta name="assert" content="image-set rendering with negative resolution">
7+
<style>
8+
#test {
9+
background-image: url("/images/red.png");
10+
background-image: image-set(url("/images/green.png") -1x);
11+
width: 100px;
12+
height: 100px;
13+
}
14+
</style>
15+
<div id="test"></div>

‎testing/web-platform/tests/css/css-images/image-set/image-set-parsing.html

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,42 @@
142142
);
143143
}
144144

145+
function test_non_positive_resolutions_parsing() {
146+
test_valid_value_variants(
147+
'background-image',
148+
'image-set(url("example.png") 0x)'
149+
);
150+
test_valid_value_variants(
151+
'background-image',
152+
'image-set(url("example.png") 0dppx)'
153+
);
154+
test_valid_value_variants(
155+
'background-image',
156+
'image-set(url("example.png") 0dpi)'
157+
);
158+
test_valid_value_variants(
159+
'background-image',
160+
'image-set(url("example.png") 0dpcm)'
161+
);
162+
163+
test_valid_value_variants(
164+
'background-image',
165+
'image-set(url("example.png") -1x)'
166+
);
167+
test_valid_value_variants(
168+
'background-image',
169+
'image-set(url("example.png") -3dppx)'
170+
);
171+
test_valid_value_variants(
172+
'background-image',
173+
'image-set(url("example.png") -96dpi)'
174+
);
175+
test_valid_value_variants(
176+
'background-image',
177+
'image-set(url("example.png") -113dpcm)'
178+
);
179+
}
180+
145181
function test_gradient_images_parsing() {
146182
test_valid_value_variants(
147183
'background-image',
@@ -265,6 +301,7 @@
265301

266302
test_default_resolution_parsing();
267303
test_resolution_units_parsing();
304+
test_non_positive_resolutions_parsing();
268305
test_gradient_images_parsing();
269306
test_image_type_parsing();
270307
test_no_images_set_nesting();

‎testing/web-platform/tests/css/css-images/image-set/image-set-zero-resolution-rendering.html

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)
Failed to load comments.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/mozilla/gecko-dev/commit/b679571ac19ecd4bb15d97d1c71aef0396e32897

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy