Bug 40166

Summary: Canvas createPattern(img, repetition) shouldn't throw INVALID_STATE_ERR when !img.complete
Product: WebKit Reporter: Andreas Kling <kling>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Severity: Normal CC: commit-queue, krit
Priority: P2 Keywords: HTML5
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Description Flags
Proposed patch
krit: review+, krit: commit-queue+
Proposed patch v2
Proposed patch v3 none

Description Andreas Kling 2010-06-04 08:24:37 PDT
Spec link:

If !img.complete, createPattern() should simply return null.
Comment 1 Andreas Kling 2010-06-04 08:26:23 PDT
Created attachment 57883 [details]
Proposed patch

Note the lack of test due to a bug in HTMLImageElement's complete attribute.
This will be addressed in a subsequent patch.
Comment 2 Dirk Schulze 2010-06-04 08:31:42 PDT
Comment on attachment 57883 [details]
Proposed patch

lgtm. r=me
Comment 3 Andreas Kling 2010-06-04 11:36:25 PDT
Created attachment 57900 [details]
Proposed patch v2

Oops! Turns out there IS a way to create an incomplete image and an existing test already covered it.
Updated patch with corrected test and ChangeLog.
Comment 4 Andreas Kling 2010-06-04 12:19:33 PDT
Created attachment 57904 [details]
Proposed patch v3

Updated patch as per our discussion on IRC.
Test is now more verbose about what it's testing.
Comment 5 Dirk Schulze 2010-06-04 12:24:09 PDT
Comment on attachment 57904 [details]
Proposed patch v3

Great! r=me
Comment 6 WebKit Commit Bot 2010-06-04 21:41:18 PDT
Comment on attachment 57904 [details]
Proposed patch v3

Clearing flags on attachment: 57904

Committed r60731: <http://trac.webkit.org/changeset/60731>
Comment 7 WebKit Commit Bot 2010-06-04 21:41:24 PDT
All reviewed patches have been landed.  Closing bug.