According to http://www.whatwg.org/specs/web-apps/current-work/#pixel-manipulation: "If any of the arguments to createImageData() or getImageData() are infinite or NaN, or if the createImageData() method is invoked with only one argument but that argument is null, the method must instead raise a NOT_SUPPORTED_ERR exception." Test page: http://philip.html5.org/tests/canvas/suite/tests/2d.imageData.create.nonfinite.html
Created attachment 34878 [details] Patch to solve the issue
I have contacted the author of the canvas tests to determine the licensing of the generated tests. If possible it would be nice to integrate them into our pixel tests and I started work in that direction, but before they can go into our repo the licensing needs to be determined.
Comment on attachment 34878 [details] Patch to solve the issue Fix looks great. But we also require a regression test for fixes like this one. Please resubmit a patch that includes a regression test. It should be straightforward to come up for a test for this. We don't need to use the canvas tests you referred to in the bug earlier. If you look in the LayoutTests/fast/canvas directory you'll see many other similar tests which could give you some ideas how to make a test that covers this fix.
philip (the author of the tests) hangs out in #webkit. You should be able to ask him there too. :)
Created attachment 34972 [details] tests + tests Same patch as before, but now with a layout test
Comment on attachment 34972 [details] tests + tests dupe
Created attachment 34973 [details] patch + tests
Created attachment 34974 [details] patch + tests
Comment on attachment 34974 [details] patch + tests It'd be nice to have some other test cases too, such as 0, positive numbers, negative numbers, and non-numeric values. r=me
Comment on attachment 34974 [details] patch + tests Clearing flags on attachment: 34974 Committing to http://svn.webkit.org/repository/webkit/trunk ... M LayoutTests/ChangeLog A LayoutTests/fast/canvas/canvas-2d-imageData-create-nonfinite-expected.txt A LayoutTests/fast/canvas/canvas-2d-imageData-create-nonfinite.html A LayoutTests/fast/canvas/resources/canvas-2d-imageData-create-nonfinite.js M WebCore/ChangeLog M WebCore/html/canvas/CanvasRenderingContext2D.cpp M WebCore/html/canvas/CanvasRenderingContext2D.h M WebCore/html/canvas/CanvasRenderingContext2D.idl Committed r47398 M WebCore/ChangeLog M WebCore/html/canvas/CanvasRenderingContext2D.cpp M WebCore/html/canvas/CanvasRenderingContext2D.h M WebCore/html/canvas/CanvasRenderingContext2D.idl M LayoutTests/ChangeLog A LayoutTests/fast/canvas/resources/canvas-2d-imageData-create-nonfinite.js A LayoutTests/fast/canvas/canvas-2d-imageData-create-nonfinite-expected.txt A LayoutTests/fast/canvas/canvas-2d-imageData-create-nonfinite.html r47398 = bfd04504c6b001c7b8907e1d3a93ce7d42cd1e6b (trunk) No changes between current HEAD and refs/remotes/trunk Resetting to the latest refs/remotes/trunk http://trac.webkit.org/changeset/47398
All reviewed patches have been landed. Closing bug.