Bug 118894

Summary: [CSS blending] Background-blend-mode doesn't apply for an SVG image with css border-style or padding property set
Product: WebKit Reporter: Mirela <mbudaes>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bunhere, cdumez, commit-queue, ddkilzer, d-r, fmalita, gyuyoung.kim, krit, lforschler, mihnea, olaru, pdr, rakuco, schenney, WebkitBugTracker
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 126988, 127056    
Bug Blocks: 108546    
Attachments:
Description Flags
Sample file
none
Patch
none
Patch for review
none
Patch
none
Includes tests with rects instead of circles
none
Updated test expectations on mac
none
Patch none

Mirela
Reported 2013-07-19 02:10:33 PDT
Created attachment 207072 [details] Sample file Setting a border-style or padding property for a div with an SVG background image results in background-blending not being applied. Sample code: <style> div { border: 5px navy; border-style: dotted double; padding: 8.5px; background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDEwMCAxMDAiPgogIDxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjQwIiBmaWxsPSJyZWQiLz4KPC9zdmc+'), green; width: 200px; height: 200px; } </style> <div style="-webkit-background-blend-mode: screen;"></div>
Attachments
Sample file (575 bytes, text/html)
2013-07-19 02:10 PDT, Mirela
no flags
Patch (22.77 KB, patch)
2014-01-13 07:48 PST, Mihai Tica
no flags
Patch for review (7.70 KB, patch)
2014-01-14 00:26 PST, Mihai Tica
no flags
Patch (7.72 KB, patch)
2014-01-14 01:22 PST, Mihai Tica
no flags
Includes tests with rects instead of circles (8.59 KB, patch)
2014-01-15 01:20 PST, Mihai Tica
no flags
Updated test expectations on mac (9.49 KB, patch)
2014-01-16 02:02 PST, Mihai Tica
no flags
Patch (9.50 KB, patch)
2014-01-16 02:26 PST, Mihai Tica
no flags
Horia Olaru
Comment 1 2013-08-01 05:31:16 PDT
I tested this with the current nightly: Version 6.0.5 (8536.30.1, 538+) I can reproduce this only using border-style. If I take out the border, and leave only the padding, background blending works. Also,the bug reproduces even without the padding added. This only seems to reproduce with data uri svg images. I could not reproduce it with a local file svg (url). It is probably worth checking if this reproduces with data uri non-svg images.
Mirela
Comment 2 2013-08-07 06:17:06 PDT
The same issue for: background-origin: content-box; background-size: - specified in pixels and percent (e.g. 50% 50%; and 100px 100px; )
Mihai Tica
Comment 3 2014-01-13 07:48:33 PST
WebKit Commit Bot
Comment 4 2014-01-13 07:50:09 PST
Attachment 221041 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/css3/compositing/background-blend-mode-data-uri-svg-image.html', u'LayoutTests/platform/mac/css3/compositing/background-blend-mode-data-uri-svg-image-expected.png', u'LayoutTests/platform/mac/css3/compositing/background-blend-mode-data-uri-svg-image-expected.txt', u'Source/WebCore/ChangeLog', u'Source/WebCore/svg/graphics/SVGImage.cpp', u'Source/WebCore/svg/graphics/SVGImage.h', u'Source/WebCore/svg/graphics/SVGImageForContainer.cpp', '--commit-queue']" exit_code: 1 Traceback (most recent call last): File "Tools/Scripts/check-webkit-style", line 48, in <module> sys.exit(CheckWebKitStyle().main()) File "/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/style/main.py", line 154, in main patch_checker.check(patch) File "/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/style/patchreader.py", line 71, in check self._text_file_reader.process_file(file_path=path, line_numbers=None) File "/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/style/filereader.py", line 118, in process_file lines = self._read_lines(file_path) File "/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/style/filereader.py", line 86, in _read_lines contents = file.read() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py", line 671, in read return self.reader.read(size) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py", line 477, in read newchars, decodedbytes = self.decode(data, self.errors) UnicodeDecodeError: 'utf8' codec can't decode byte 0x89 in position 0: invalid start byte If any of these errors are false positives, please file a bug against check-webkit-style.
Mihai Tica
Comment 5 2014-01-14 00:26:58 PST
Created attachment 221114 [details] Patch for review Replacing pixel with ref test
Dirk Schulze
Comment 6 2014-01-14 00:29:16 PST
Comment on attachment 221114 [details] Patch for review View in context: https://bugs.webkit.org/attachment.cgi?id=221114&action=review > LayoutTests/css3/compositing/background-blend-mode-data-uri-svg-image-expected.html:7 > + background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDEwMCAxMDAiPg0KICA8Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI0MCIgZmlsbD0iIzBGMCIvPg0KPC9zdmc+'), #FF0; please no base64 encoded SVGs, normal data urls with readable SVG please. > LayoutTests/css3/compositing/background-blend-mode-data-uri-svg-image.html:7 > + background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDEwMCAxMDAiPg0KICA8Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI0MCIgZmlsbD0iI0YwMCIvPg0KPC9zdmc+'), #FF0; Ditto.
Mihai Tica
Comment 7 2014-01-14 01:22:55 PST
Created attachment 221120 [details] Patch Converted SVG encoding to UTF8
WebKit Commit Bot
Comment 8 2014-01-14 07:34:20 PST
Comment on attachment 221120 [details] Patch Clearing flags on attachment: 221120 Committed r161964: <http://trac.webkit.org/changeset/161964>
WebKit Commit Bot
Comment 9 2014-01-14 07:34:23 PST
All reviewed patches have been landed. Closing bug.
Alexey Proskuryakov
Comment 10 2014-01-14 09:38:33 PST
These tests are now failing on Mavericks Debug bots: css3/compositing/background-blend-mode-crossfade-image.htmlhistory css3/compositing/background-blend-mode-data-uri-svg-image.html One looks like a color diff, another is antialiasing.
Alexey Proskuryakov
Comment 11 2014-01-14 09:53:03 PST
Not sure if it's this change that is to blame, there were multiple related changes landed at once, and tested at once.
Dirk Schulze
Comment 12 2014-01-14 10:07:18 PST
(In reply to comment #11) > Not sure if it's this change that is to blame, there were multiple related changes landed at once, and tested at once. (In reply to comment #10) > These tests are now failing on Mavericks Debug bots: > > css3/compositing/background-blend-mode-crossfade-image.htmlhistory > css3/compositing/background-blend-mode-data-uri-svg-image.html > > One looks like a color diff, another is antialiasing. I think we can deal with these tests differently. It should be easy to find a compositing mode that calculates to black if one layer is red and the other green. We should roll the patch out and redo the tests.
WebKit Commit Bot
Comment 13 2014-01-14 10:12:15 PST
Re-opened since this is blocked by bug 126988
Alexey Proskuryakov
Comment 14 2014-01-14 10:19:21 PST
This change was responsible for css3/compositing/background-blend-mode-data-uri-svg-image.html failures seen on some of the bots: <http://build.webkit.org/results/Apple%20Mavericks%20Debug%20WK2%20(Tests)/r161973%20(1629)/css3/compositing/background-blend-mode-data-uri-svg-image-diffs.html>. This looks like an antialiasing only diff. Complete history: <http://webkit-test-results.appspot.com/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=css3%2Fcompositing%2Fbackground-blend-mode-data-uri-svg-image.html>. For some reason, this bug cannot be re-opened!
David Kilzer (:ddkilzer)
Comment 15 2014-01-14 12:27:40 PST
Attempting to reopen with Web Inspector editing of the form.
Mihai Tica
Comment 16 2014-01-15 01:20:21 PST
Created attachment 221239 [details] Includes tests with rects instead of circles Adding a new version of the patch that uses rectangles in the tests instead of circles. Also skipping efl for the test and testing the hardware path.
Dirk Schulze
Comment 17 2014-01-15 01:27:10 PST
Comment on attachment 221239 [details] Includes tests with rects instead of circles That looks better, lets wait for the bots first.
WebKit Commit Bot
Comment 18 2014-01-15 04:27:53 PST
Comment on attachment 221239 [details] Includes tests with rects instead of circles Clearing flags on attachment: 221239 Committed r162066: <http://trac.webkit.org/changeset/162066>
WebKit Commit Bot
Comment 19 2014-01-15 04:27:57 PST
All reviewed patches have been landed. Closing bug.
Alexey Proskuryakov
Comment 21 2014-01-15 10:22:03 PST
Looks like neither author nor reviewer are available to advise on the best course of action, so rolling out again.
WebKit Commit Bot
Comment 22 2014-01-15 10:23:02 PST
Re-opened since this is blocked by bug 127056
Mihai Tica
Comment 23 2014-01-16 02:02:16 PST
Created attachment 221348 [details] Updated test expectations on mac This patch skips the added test on mac as the result from applying blending is slightly different than the result of the blending formula.
Mihai Tica
Comment 24 2014-01-16 02:26:51 PST
Created attachment 221350 [details] Patch Add Pass aswell for test on mac
WebKit Commit Bot
Comment 25 2014-01-20 08:11:25 PST
Comment on attachment 221350 [details] Patch Clearing flags on attachment: 221350 Committed r162341: <http://trac.webkit.org/changeset/162341>
WebKit Commit Bot
Comment 26 2014-01-20 08:11:29 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.