RESOLVED FIXED 159373
"image-src" support is missing. We only support "-webkit-image-src"
https://bugs.webkit.org/show_bug.cgi?id=159373
Summary "image-src" support is missing. We only support "-webkit-image-src"
Brent Fulgham
Reported 2016-07-01 15:15:46 PDT
We only support the prefixed version of "image-src" (i.e., "-webkit-image-src"). We should support the unprefixed variant of this CSS.
Attachments
Test case showing the null image (61.44 KB, application/zip)
2016-07-01 15:18 PDT, Brent Fulgham
no flags
Patch (16.56 KB, patch)
2016-07-01 16:52 PDT, Brent Fulgham
dino: review+
CSSParser.diff (3.22 KB, patch)
2016-07-01 16:58 PDT, Dean Jackson
no flags
Brent Fulgham
Comment 1 2016-07-01 15:18:41 PDT
Created attachment 282590 [details] Test case showing the null image Test case showing "image-src(...)" is not supported
Radar WebKit Bug Importer
Comment 2 2016-07-01 15:19:19 PDT
Brent Fulgham
Comment 3 2016-07-01 16:52:41 PDT
Dean Jackson
Comment 4 2016-07-01 16:57:04 PDT
Comment on attachment 282608 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=282608&action=review > Source/WebCore/css/CSSParser.cpp:2096 > + } else if (value->unit == CSSParserValue::Function && (equalLettersIgnoringASCIICase(value->function->name, "image-set(") > + || equalLettersIgnoringASCIICase(value->function->name, "-webkit-image-set("))) { I did this: +static bool isImageSetFunctionValue(const CSSParserValue& value) +{ + return value.unit == CSSParserValue::Function && (equalLettersIgnoringASCIICase(value.function->name, "image-set(") || equalLettersIgnoringASCIICase(value.function->name, "-webkit-image-set(")); +} + And then used it throughout CSSParser.cpp > LayoutTests/fast/css/script-tests/image-set-setting.js:18 > - var fullRule = "-webkit-image-set(" + rule + ")"; > + var fullRule = "image-set(" + rule + ")"; I think we should have this test both forms.
Dean Jackson
Comment 5 2016-07-01 16:58:24 PDT
Created attachment 282609 [details] CSSParser.diff
Brent Fulgham
Comment 6 2016-07-01 16:59:55 PDT
Comment on attachment 282608 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=282608&action=review >> Source/WebCore/css/CSSParser.cpp:2096 >> + || equalLettersIgnoringASCIICase(value->function->name, "-webkit-image-set("))) { > > I did this: > > +static bool isImageSetFunctionValue(const CSSParserValue& value) > +{ > + return value.unit == CSSParserValue::Function && (equalLettersIgnoringASCIICase(value.function->name, "image-set(") || equalLettersIgnoringASCIICase(value.function->name, "-webkit-image-set(")); > +} > + > > And then used it throughout CSSParser.cpp That's much better. >> LayoutTests/fast/css/script-tests/image-set-setting.js:18 >> + var fullRule = "image-set(" + rule + ")"; > > I think we should have this test both forms. I tried that initially, but the behavior of 'cssText' causes trouble. If I create a rule using "-webkit-image-set" it round-trips as "image-set", which breaks the test.
Dean Jackson
Comment 7 2016-07-01 17:23:21 PDT
David Kilzer (:ddkilzer)
Comment 8 2016-07-03 05:01:42 PDT
(In reply to comment #7) > Committed r202765: <http://trac.webkit.org/changeset/202765> Layout test results fix for iOS Simulator: Committed r202786: <https://trac.webkit.org/changeset/202786>
yisibl
Comment 9 2016-08-15 01:04:08 PDT
Please support the standard syntax: Each <string> inside image-set() represents a <url>, just like in image(). image-set( "foo.png" 1x, "foo-2x.png" 2x, "foo-print.png" 600dpi );
Brent Fulgham
Comment 10 2016-08-16 10:34:54 PDT
(In reply to comment #9) > Please support the standard syntax: > > Each <string> inside image-set() represents a <url>, just like in image(). > > image-set( "foo.png" 1x, "foo-2x.png" 2x, "foo-print.png" 600dpi ); Could you please file a new Bug for this issue so we can track it more easily, since this bug is already closed? Thanks!
Note You need to log in before you can comment on or make changes to this bug.