Bug 229909 - -webkit-image-set() should be an alias of image-set()
Summary: -webkit-image-set() should be an alias of image-set()
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryan Reno
URL: https://wpt.fyi/results/css/css-image...
Keywords: BrowserCompat, InRadar, WPTImpact
Depends on: 203788
  Show dependency treegraph
Reported: 2021-09-03 19:25 PDT by Sam Sneddon [:gsnedders]
Modified: 2023-02-27 08:14 PST (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Sam Sneddon [:gsnedders] 2021-09-03 19:25:17 PDT
Per https://github.com/w3c/csswg-drafts/issues/6285, it was decided to make -webkit-image-set a parse-time alias.
Comment 1 Radar WebKit Bug Importer 2021-09-10 19:26:17 PDT
Comment 2 Sam Sneddon [:gsnedders] 2021-10-01 06:52:20 PDT
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
Comment 3 Sam Sneddon [:gsnedders] 2022-10-31 04:05:51 PDT
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.
Comment 4 Karl Dubost 2023-01-26 00:13:10 PST
Not sure why some of these tests are failing 

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)"
Comment 5 Karl Dubost 2023-01-26 00:14:07 PST
Probably necessary for Interop2023.

Note that -webkit-image-set() is already an alias of image-set
Comment 6 Sam Sneddon [:gsnedders] 2023-01-30 04:31:14 PST
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
Comment 7 Karl Dubost 2023-01-30 04:41:32 PST
Ah thanks for the link, Sam. 
I need to dig into this for understanding the differences.
Comment 8 Ryan Reno 2023-02-06 15:04:17 PST
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.
Comment 9 Ryan Reno 2023-02-06 15:21:02 PST
Pull request: https://github.com/WebKit/WebKit/pull/9718
Comment 10 Ryan Reno 2023-02-07 11:20:39 PST
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/38394
Comment 11 EWS 2023-02-07 22:50:51 PST
Committed 259994@main (5e38273c02f7): <https://commits.webkit.org/259994@main>

Reviewed commits have been landed. Closing PR #9718 and removing active labels.