[Webkit-unassigned] [Bug 141755] [Canvas] apply NOT_SUPPORTED_ERR to putImageData()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 18 10:05:44 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=141755

--- Comment #6 from Chris Dumez <cdumez at apple.com> ---
Comment on attachment 246817
  --> https://bugs.webkit.org/attachment.cgi?id=246817
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150218/3613ee8c/attachment-0002.html>


More information about the webkit-unassigned mailing list