Bug 33968

Summary: Canvas: Exception erroneously thrown for drawImage() when image.complete=false
Product: WebKit Reporter: Kai Hendry <hendry>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: adele, commit-queue, kling, mdelaney7
Priority: P2 Keywords: HTML5
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://code.google.com/p/chromium/issues/detail?id=32712
Attachments:
Description Flags
Proposed patch none

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:
http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-drawimage
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.