Bug 33968 - Canvas: Exception erroneously thrown for drawImage() when image.complete=false
Summary: Canvas: Exception erroneously thrown for drawImage() when image.complete=false
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://code.google.com/p/chromium/iss...
Keywords: HTML5
Depends on:
Reported: 2010-01-21 12:42 PST by Kai Hendry
Modified: 2010-07-01 10:34 PDT (History)
4 users (show)

See Also:

Proposed patch (5.87 KB, patch)
2010-06-29 07:51 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Hendry 2010-01-21 12:42:20 PST
Just tried http://roulette.dabase.com/ on r53596 and it also fails to render, while Gecko and Presto can.

I can work around on this problem by adding a timeout. There is some bizaare DOM ready bug I guess.
Comment 1 Andreas Kling 2010-06-29 07:16:56 PDT
Both the site and WebKit are at fault here.

The page is using $(document).ready() instead of $(window).load() - $d(document).ready() fires as soon as the DOM is ready instead of waiting for subresources (images in this case) to finish loading.

However, since the image element passed to drawImage() has complete=false, nothing should be done (HTML5 4.8.11), so the exception is thrown in error.

Patch coming in a moment.
Comment 2 Andreas Kling 2010-06-29 07:51:59 PDT
Created attachment 60021 [details]
Proposed patch

Implement correct behavior for drawImage() with incomplete image or video. Autotest included.

Spec link:
Comment 3 Andreas Kling 2010-07-01 07:57:40 PDT
For future visitors to this bug, the page at http://roulette.dabase.com/ has now been updated to use $(window).load() :-)
Comment 4 WebKit Commit Bot 2010-07-01 10:29:41 PDT
Comment on attachment 60021 [details]
Proposed patch

Clearing flags on attachment: 60021

Committed r62273: <http://trac.webkit.org/changeset/62273>
Comment 5 WebKit Commit Bot 2010-07-01 10:29:46 PDT
All reviewed patches have been landed.  Closing bug.