Bug 40166 - Canvas createPattern(img, repetition) shouldn't throw INVALID_STATE_ERR when !img.complete
Summary: Canvas createPattern(img, repetition) shouldn't throw INVALID_STATE_ERR when ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: HTML5
Depends on:
Blocks:
 
Reported: 2010-06-04 08:24 PDT by Andreas Kling
Modified: 2010-06-04 21:41 PDT (History)
2 users (show)

See Also:


Attachments
Proposed patch (1.40 KB, patch)
2010-06-04 08:26 PDT, Andreas Kling
krit: review+
krit: commit-queue+
Details | Formatted Diff | Diff
Proposed patch v2 (2.85 KB, patch)
2010-06-04 11:36 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff
Proposed patch v3 (3.99 KB, patch)
2010-06-04 12:19 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 Andreas Kling 2010-06-04 08:24:37 PDT
Spec link:
http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-createpattern

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.