putImageData() throws NOT_SUPPORTED_ERR if arguments are not finite Actual output: Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Argument 2 of CanvasRenderingContext2D.putImageData is not a finite floating-point value. * References: 2d.imageData.put.nonfinite http://flashcanvas.net/examples/philip.html5.org/tests/canvas/suite/tests/2d.imageData.put.nonfinite.html
Created attachment 246817 [details] Patch
Comment on attachment 246817 [details] Patch Attachment 246817 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/6211018736795648 New failing tests: fast/canvas/canvas-putImageData.html canvas/philip/tests/2d.imageData.put.nonfinite.html
Created attachment 246822 [details] Archive of layout-test-results from ews100 for mac-mavericks The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-mavericks Platform: Mac OS X 10.9.5
Comment on attachment 246817 [details] Patch Attachment 246817 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/5779819052662784 New failing tests: fast/canvas/canvas-putImageData.html canvas/philip/tests/2d.imageData.put.nonfinite.html
Created attachment 246824 [details] Archive of layout-test-results from ews106 for mac-mavericks-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-mavericks-wk2 Platform: Mac OS X 10.9.5
Comment on attachment 246817 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=246817&action=review The numeric arguments are not unrestricted as per the spec (both W3C and WhatWG). Therefore, infinite / NaN is already rejected at Web IDL level with a Type Error. The W3C specification really should not specify that a NOT_SUPPORTED_ERROR be thrown in this case because it cannot happen AFAIK. Note that the latest WhatWG spec does not indicate that a NOT_SUPPORTED_ERR should be thrown (https://html.spec.whatwg.org/multipage/scripting.html#dom-context-2d-putimagedata), only the W3C one does. Honestly, here, there isn't much benefit in adding more code just to throw a different exception. We already throw because of the Web IDL. > Source/WebCore/html/canvas/CanvasRenderingContext2D.idl:163 > + [RaisesException] void putImageData(ImageData? imagedata, unrestricted float dx, unrestricted float dy); These are not unrestricted as per the spec. > Source/WebCore/html/canvas/CanvasRenderingContext2D.idl:164 > + [RaisesException] void putImageData(ImageData? imagedata, unrestricted float dx, unrestricted float dy, unrestricted float dirtyX, unrestricted float dirtyY, unrestricted float dirtyWidth, unrestricted float dirtyHeight); ditto.
> Honestly, here, there isn't much benefit in adding more code just to throw a different exception. agreed to your idea.