RESOLVED INVALID134503
Canvas drawImage from SVG fails, even sans foreignObject
https://bugs.webkit.org/show_bug.cgi?id=134503
Summary Canvas drawImage from SVG fails, even sans foreignObject
BrianMB
Reported 2014-07-01 11:54:12 PDT
When SVG images do not contain the foreignObject element, the Canvas API should treat them like any other image type. At current, they appear to fail no matter what. Live test: http://codepen.io/brianblakely/full/Ccoda Chrome/Firefox output (correct): http://i.imgur.com/irvfNUj.png WebKit/IE output (incorrect): http://i.imgur.com/7o1L3SP.png
Attachments
BrianMB
Comment 1 2014-07-01 11:58:39 PDT
Naturally, since drawImage never happens, getImageData fails as well. The test includes an indicator for both method calls.
BrianMB
Comment 2 2014-07-04 16:23:44 PDT
WebKit screenshot is from r170805 OS X 10.9.3
Dirk Schulze
Comment 3 2014-07-04 23:05:53 PDT
It would be great if you could upload examples to Bugzilla directly in the future. It seems hat you are using Blobs in your example. Blobs with data (at least SVG data but I think in general) are not supported in WebKit yet. There should be open bugs for that. Thanks for reporting.
Timothy Hatcher
Comment 4 2014-07-04 23:16:17 PDT
I fixed this with bug 119492 with tests. Web Inspector uses it. So you might be doing something else WebKit does not like (as Dirk said, using blobs.)
BrianMB
Comment 5 2014-07-07 09:03:36 PDT
@Dirk: I will upload directly in the future. Is there any documentation on best pracs for live bug demos? Help section is not very helpful in that regard. I checked Blob support on Can I Use and MDN before incorporating into the demo. Unfortunately they didn't note any gaps in support! @Timothy: I will update my demo to not use blobs and check again. Last time I ran a round of testing on SVG+Canvas was over a year ago, prior to your commit, so it made sense to see it still broken. Annoying if that blob usage is definitely the problem, but at least I'm aware of the issue now.
BrianMB
Comment 6 2014-07-17 14:17:45 PDT
http://codepen.io/brianblakely/full/Ccoda I have modified my test case, and confirmed the feedback. Thank you!
Daniel Trebbien
Comment 7 2014-11-28 10:17:44 PST
So this bug is fixed? In Safari 8.0 (10600.1.25.1) I see the crab image twice on the test case: http://codepen.io/brianblakely/full/Ccoda
BrianMB
Comment 8 2014-11-30 10:27:42 PST
This ticket can be closed. The problem was with Blob.
Note You need to log in before you can comment on or make changes to this bug.