Bug 229909
Summary: | -webkit-image-set() should be an alias of image-set() | ||
---|---|---|---|
Product: | WebKit | Reporter: | Sam Sneddon [:gsnedders] <gsnedders> |
Component: | CSS | Assignee: | Ryan Reno <rreno> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | karlcow, rreno, webkit-bug-importer |
Priority: | P2 | Keywords: | BrowserCompat, InRadar, WPTImpact |
Version: | WebKit Local Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | https://wpt.fyi/results/css/css-images/image-set/image-set-parsing.html?label=master&label=experimental&product=chrome&product=firefox&product=safari&aligned&view=interop&q=label%3Ainterop-2023-webcompat | ||
See Also: |
https://bugs.webkit.org/show_bug.cgi?id=206909 https://github.com/web-platform-tests/wpt/pull/38394 https://bugs.webkit.org/show_bug.cgi?id=251811 |
||
Bug Depends on: | 203788 | ||
Bug Blocks: |
Sam Sneddon [:gsnedders]
Per https://github.com/w3c/csswg-drafts/issues/6285, it was decided to make -webkit-image-set a parse-time alias.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/82999675>
Sam Sneddon [:gsnedders]
per bug 206909 we did actually briefly do this, but this then got reverted due to Gmail breakage, gonna file a new bug for fixing the underlying issue there and mark this as blocked on that
Sam Sneddon [:gsnedders]
The prior Gmail issue no longer seems to trivially reproduce, as empty URLs in image-set no longer cause a broken image icon to be shown.
Karl Dubost
Not sure why some of these tests are failing
http://wpt.live/css/css-images/image-set/image-set-parsing.html
But manually it is working.
> document.body.style.backgroundImage
< ""
> document.body.style['background-image']
< ""
> document.body.style.backgroundImage = "-webkit-image-set(url('example.png') 1x)"
< "-webkit-image-set(url('example.png') 1x)"
> document.body.style.backgroundImage
< "image-set(url(\"example.png\") 1x)"
> document.body.style['background-image']
< "image-set(url(\"example.png\") 1x)"
> document.body.style.getPropertyValue("background-image")
< "image-set(url(\"example.png\") 1x)"
Karl Dubost
Probably necessary for Interop2023.
Note that -webkit-image-set() is already an alias of image-set
Sam Sneddon [:gsnedders]
It sorta is and sorta isn't. It still has its own parser: https://github.com/WebKit/WebKit/blob/1e76207c4357149a69994b53bb756f31996c13df/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp#L4666
Karl Dubost
Ah thanks for the link, Sam.
I need to dig into this for understanding the differences.
Ryan Reno
I can't reproduce the gmail issue with this simple diff:
diff --git a/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp b/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
index 173d2397e7c4..5c836404e9ba 100644
--- a/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
+++ b/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
@@ -4672,10 +4672,8 @@ RefPtr<CSSValue> consumeImage(CSSParserTokenRange& range, const CSSParserContext
return consumeGeneratedImage(range, context);
if (allowedImageTypes.contains(AllowedImageType::ImageSet)) {
- if (functionId == CSSValueImageSet)
+ if (functionId == CSSValueImageSet || functionId == CSSValueWebkitImageSet)
return consumeImageSet(range, context, (allowedImageTypes | AllowedImageType::RawStringAsURL) - AllowedImageType::ImageSet);
- if (functionId == CSSValueWebkitImageSet)
- return consumeImageSet(range, context, AllowedImageType::URLFunction);
}
}
But that diff does progress some of the WPT subtests we are currently failing because we don't implement -webkit-image-set as an alias.
Ryan Reno
Pull request: https://github.com/WebKit/WebKit/pull/9718
Ryan Reno
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/38394
EWS
Committed 259994@main (5e38273c02f7): <https://commits.webkit.org/259994@main>
Reviewed commits have been landed. Closing PR #9718 and removing active labels.