Bug 28454

Summary: <canvas> createImageData doesn't handle negative values properly
Product: WebKit Reporter: George Wright <gwright>
Component: WebCore Misc.Assignee: George Wright <gwright>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, kling
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
URL: http://philip.html5.org/tests/canvas/suite/tests/2d.imageData.create.negative.html
Attachments:
Description Flags
Handle negatives properly
none
Include layout tests eric: review-

Description George Wright 2009-08-19 08:11:52 PDT
According to http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-createimagedata, createImageData should create an ImageData object with width and height equal to the absolute magnitude of the values passed to createImageData. WebKit currently does not do this.
Comment 1 George Wright 2009-08-19 08:42:10 PDT
Created attachment 35122 [details]
Handle negatives properly

Proposed fix for this bug.
Comment 2 George Wright 2009-08-19 09:42:42 PDT
Created attachment 35125 [details]
Include layout tests

Woops, old patch didn't include the layout tests for some reason.
Comment 3 Darin Adler 2009-08-19 10:15:22 PDT
Comment on attachment 35125 [details]
Include layout tests

Seems that this test should be a dumpAsText cross-platform test, the way many of the tests in fast/canvas are, such as canvas-alphaImageData-behavior.html for example. That would be more valuable than one with platform-specific results.

r=me as is, but please consider making that change
Comment 4 Eric Seidel (no email) 2009-08-21 15:00:45 PDT
Comment on attachment 35125 [details]
Include layout tests

Since George isn't a committer and won't be able to commit this when landing, marking this r- per Darin's above comments.  I agree, this would be nicer as a dumpAsText test.
Comment 5 Andreas Kling 2010-07-11 06:29:56 PDT
I fixed this with http://trac.webkit.org/changeset/59613 (bug 39189)