Bug 70088

Summary: canvas getImageData should explain why it throws SECURITY_ERR
Product: WebKit Reporter: Adam Barth <abarth>
Component: CanvasAssignee: Adam Barth <abarth>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, mdelaney7, ulfar.erlingsson, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing none

Adam Barth
Reported 2011-10-13 21:31:39 PDT
Our poor error reporting confused Ulfar and made him sad. Let's make him happy by adding a console message explaining why he can't read data from his canvas.
Attachments
Patch (13.73 KB, patch)
2011-10-13 21:38 PDT, Adam Barth
no flags
Patch (14.24 KB, patch)
2011-10-13 22:10 PDT, Adam Barth
no flags
Patch for landing (14.21 KB, patch)
2011-10-14 12:14 PDT, Adam Barth
no flags
Adam Barth
Comment 1 2011-10-13 21:38:37 PDT
WebKit Review Bot
Comment 2 2011-10-13 22:05:28 PDT
Comment on attachment 110954 [details] Patch Attachment 110954 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/10060424 New failing tests: fast/canvas/svg-taint.html
Adam Barth
Comment 3 2011-10-13 22:10:37 PDT
Darin Adler
Comment 4 2011-10-14 08:37:17 PDT
Comment on attachment 110956 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=110956&action=review > Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:1762 > + DEFINE_STATIC_LOCAL(String, consoleMessage, ("Unable to get image data from canvas because the canvas has been tainted by cross-origin data.\n")); Do these messages really need newlines? I think this is an extra unneeded newline.
Darin Adler
Comment 5 2011-10-14 08:38:26 PDT
Comment on attachment 110956 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=110956&action=review > Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:59 > +#include "ScriptCallStack.h" We should overload the addMessage function so callers that have no script context can use it without including ScriptCallStack.h and without supplying the number 1 and empty string just to say “I am not a script!”.
Adam Barth
Comment 6 2011-10-14 12:07:36 PDT
(In reply to comment #5) > (From update of attachment 110956 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=110956&action=review > > > Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:59 > > +#include "ScriptCallStack.h" > > We should overload the addMessage function so callers that have no script context can use it without including ScriptCallStack.h and without supplying the number 1 and empty string just to say “I am not a script!”. Yes. If it's ok with you, I'd like to do that in a separate patch so I can update all the callers at the same time. Doing that in this patch would expand the scope of this patch significantly.
Adam Barth
Comment 7 2011-10-14 12:14:38 PDT
Created attachment 111045 [details] Patch for landing
WebKit Review Bot
Comment 8 2011-10-14 14:50:06 PDT
Comment on attachment 111045 [details] Patch for landing Clearing flags on attachment: 111045 Committed r97509: <http://trac.webkit.org/changeset/97509>
WebKit Review Bot
Comment 9 2011-10-14 14:50:12 PDT
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.