Content-Length: 398440 | pFad | http://github.com/nt1m/WebKit/commit/16b8db106b34eb5aaa7fc5187e205bf4c4fa9834

21 [image-set] Stop rejecting negative resolutions · nt1m/WebKit@16b8db1 · 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 16b8db1

Browse files
committedMar 24, 2023
[image-set] Stop rejecting negative resolutions
https://bugs.webkit.org/show_bug.cgi?id=254388 rdar://107167273 Reviewed by NOBODY (OOPS!). Resolution ranges are currently not restricted by the specification, so we should accept them. Corresponding WPT commit with more details: web-platform-tests/wpt@6dd9e79 The two unskipped tests are for rendering, negative resolutions are considered invalid for rendering purposes, so they display as blank. However, they are still parsed, which means the declaration stays valid, which wasn't the case before. Also rebaseline parsing tests. It is possible that the spec changes again in the future: w3c/csswg-drafts#8532 * LayoutTests/TestExpectations: * LayoutTests/imported/w3c/web-platform-tests/css/css-images/image-set/image-set-parsing-expected.txt: * Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeImageSetOption):
1 parent 10170ea commit 16b8db1

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed
 

‎LayoutTests/TestExpectations

-3
Original file line numberDiff line numberDiff line change
@@ -4641,9 +4641,6 @@ webkit.org/b/214456 imported/w3c/web-platform-tests/css/css-images/tiled-conic-g
46414641

46424642
webkit.org/b/149828 imported/w3c/web-platform-tests/css/css-images/image-orientation/image-orientation-mask-image.html [ ImageOnlyFailure ]
46434643

4644-
webkit.org/b/254390 imported/w3c/web-platform-tests/css/css-images/image-set/image-set-negative-resolution-rendering-2.html [ ImageOnlyFailure ]
4645-
webkit.org/b/254390 imported/w3c/web-platform-tests/css/css-images/image-set/image-set-negative-resolution-rendering.html [ ImageOnlyFailure ]
4646-
46474644
webkit.org/b/214457 imported/w3c/web-platform-tests/css/css-lists/change-list-descendant-display.html [ ImageOnlyFailure ]
46484645
webkit.org/b/214457 imported/w3c/web-platform-tests/css/css-lists/counter-set-001.html [ ImageOnlyFailure ]
46494646
webkit.org/b/214457 imported/w3c/web-platform-tests/css/css-lists/inline-block-list.html [ ImageOnlyFailure ]

‎LayoutTests/imported/w3c/web-platform-tests/css/css-images/image-set/image-set-parsing-expected.txt

+16-16
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,22 @@ PASS e.style['background-image'] = "image-set(url(\"example.png\") calc(2x - 1))
6969
PASS e.style['background-image'] = "-webkit-image-set(url(\"example.png\") calc(2x - 1))" should not set the property value
7070
PASS e.style['background-image'] = "image-set(url(\"example.png\") calc(1 + 4dpi))" should not set the property value
7171
PASS e.style['background-image'] = "-webkit-image-set(url(\"example.png\") calc(1 + 4dpi))" should not set the property value
72-
FAIL e.style['background-image'] = "image-set(url(\"example.png\") 0x)" should set the property value assert_not_equals: property should be set got disallowed value ""
73-
FAIL e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 0x)" should set the property value assert_not_equals: property should be set got disallowed value ""
74-
FAIL e.style['background-image'] = "image-set(url(\"example.png\") 0dppx)" should set the property value assert_not_equals: property should be set got disallowed value ""
75-
FAIL e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 0dppx)" should set the property value assert_not_equals: property should be set got disallowed value ""
76-
FAIL e.style['background-image'] = "image-set(url(\"example.png\") 0dpi)" should set the property value assert_not_equals: property should be set got disallowed value ""
77-
FAIL e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 0dpi)" should set the property value assert_not_equals: property should be set got disallowed value ""
78-
FAIL e.style['background-image'] = "image-set(url(\"example.png\") 0dpcm)" should set the property value assert_not_equals: property should be set got disallowed value ""
79-
FAIL e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 0dpcm)" should set the property value assert_not_equals: property should be set got disallowed value ""
80-
FAIL e.style['background-image'] = "image-set(url(\"example.png\") -1x)" should set the property value assert_not_equals: property should be set got disallowed value ""
81-
FAIL e.style['background-image'] = "-webkit-image-set(url(\"example.png\") -1x)" should set the property value assert_not_equals: property should be set got disallowed value ""
82-
FAIL e.style['background-image'] = "image-set(url(\"example.png\") -3dppx)" should set the property value assert_not_equals: property should be set got disallowed value ""
83-
FAIL e.style['background-image'] = "-webkit-image-set(url(\"example.png\") -3dppx)" should set the property value assert_not_equals: property should be set got disallowed value ""
84-
FAIL e.style['background-image'] = "image-set(url(\"example.png\") -96dpi)" should set the property value assert_not_equals: property should be set got disallowed value ""
85-
FAIL e.style['background-image'] = "-webkit-image-set(url(\"example.png\") -96dpi)" should set the property value assert_not_equals: property should be set got disallowed value ""
86-
FAIL e.style['background-image'] = "image-set(url(\"example.png\") -113dpcm)" should set the property value assert_not_equals: property should be set got disallowed value ""
87-
FAIL e.style['background-image'] = "-webkit-image-set(url(\"example.png\") -113dpcm)" should set the property value assert_not_equals: property should be set got disallowed value ""
72+
PASS e.style['background-image'] = "image-set(url(\"example.png\") 0x)" should set the property value
73+
PASS e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 0x)" should set the property value
74+
PASS e.style['background-image'] = "image-set(url(\"example.png\") 0dppx)" should set the property value
75+
PASS e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 0dppx)" should set the property value
76+
PASS e.style['background-image'] = "image-set(url(\"example.png\") 0dpi)" should set the property value
77+
PASS e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 0dpi)" should set the property value
78+
PASS e.style['background-image'] = "image-set(url(\"example.png\") 0dpcm)" should set the property value
79+
PASS e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 0dpcm)" should set the property value
80+
PASS e.style['background-image'] = "image-set(url(\"example.png\") -1x)" should set the property value
81+
PASS e.style['background-image'] = "-webkit-image-set(url(\"example.png\") -1x)" should set the property value
82+
PASS e.style['background-image'] = "image-set(url(\"example.png\") -3dppx)" should set the property value
83+
PASS e.style['background-image'] = "-webkit-image-set(url(\"example.png\") -3dppx)" should set the property value
84+
PASS e.style['background-image'] = "image-set(url(\"example.png\") -96dpi)" should set the property value
85+
PASS e.style['background-image'] = "-webkit-image-set(url(\"example.png\") -96dpi)" should set the property value
86+
PASS e.style['background-image'] = "image-set(url(\"example.png\") -113dpcm)" should set the property value
87+
PASS e.style['background-image'] = "-webkit-image-set(url(\"example.png\") -113dpcm)" should set the property value
8888
PASS e.style['background-image'] = "image-set(linear-gradient(black, white) 1x)" should set the property value
8989
PASS e.style['background-image'] = "-webkit-image-set(linear-gradient(black, white) 1x)" should set the property value
9090
PASS e.style['background-image'] = "image-set(repeating-linear-gradient(red, blue 25%) 1x)" should set the property value

‎Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -4471,8 +4471,6 @@ static RefPtr<CSSImageSetOptionValue> consumeImageSetOption(CSSParserTokenRange&
44714471
return nullptr;
44724472

44734473
if (optionalArgument->isResolution()) {
4474-
if (optionalArgument->floatValue() <= 0)
4475-
return nullptr;
44764474
resolution = optionalArgument;
44774475
result->setResolution(optionalArgument.releaseNonNull());
44784476
continue;

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/nt1m/WebKit/commit/16b8db106b34eb5aaa7fc5187e205bf4c4fa9834

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy