Bug 251197
| Summary: | resolution is an optional parameter on image-set() | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Karl Dubost <karlcow> |
| Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | ntim, rreno, simon.fraser, webkit-bug-importer |
| Priority: | P2 | Keywords: | BrowserCompat, InRadar, WPTImpact |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | https://wpt.fyi/results/css/css-images/image-set/image-set-no-res-rendering-2.html?label=master&label=experimental&product=chrome&product=firefox&product=safari&aligned&view=interop&q=label%3Ainterop-2023-webcompat | ||
Karl Dubost
Interop2023
Test is failing
https://wpt.fyi/results/css/css-images/image-set/image-set-no-res-rendering-2.html?label=master&label=experimental&product=chrome&product=firefox&product=safari&aligned&view=interop&q=label%3Ainterop-2023-webcompat
#test {
background-image: image-set(url("/images/green.png"), url("/images/green.png"));
width: 100px;
height: 100px;
}
is a valid syntax.
Safari accepts only
#test {
background-image: image-set(url("/images/green.png") 1x, url("/images/green.png") 1x);
width: 100px;
height: 100px;
}
The spec says:
https://w3c.github.io/csswg-drafts/css-images-4/#image-set-notation
A <resolution> (optional). This is used to help the UA decide which <image-set-option> to choose. If the image reference is for a raster image, it also specifies the image’s natural resolution, overriding any other source of data that might supply a natural resolution.
If not specified, it behaves as 1x for the purpose of selecting which <image-set-option> to use. It also defaults the image’s natural resolution to 1x, but if some other source of data supplies a natural resolution, that resolution must be honored instead.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/104683761>
Tim Nguyen (:ntim)
This should be trivial to fix: https://searchfox.org/wubkat/rev/1c8b29ff201022e3a20578244e85d25d1b7706c4/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp#4432-4436
Not sure how the <= 0 case should be handled, but the !resolution case needs to fallback to 1 instead of doing an early return.
Ryan Reno
I'm going to dup this to https://bugs.webkit.org/show_bug.cgi?id=225185 since the fix for both of these bugs is best landed together.
*** This bug has been marked as a duplicate of bug 225185 ***