W3C home > Mailing lists > Public > public-html@w3.org > May 2008

Re: Canvas ImageData comments

From: Philip Taylor <pjt47@cam.ac.uk>
Date: Sun, 04 May 2008 22:56:51 +0100
Message-ID: <481E3123.2040701@cam.ac.uk>
To: HTML WG <public-html@w3.org>

Philip Taylor wrote:
> "If any of the arguments to createImageData() or getImageData() are 
> infinite or NaN, or if either the sw or sh arguments are zero, the 
> method must instead raise an INDEX_SIZE_ERR exception.", and "If any of 
> the arguments to the method are infinite or NaN, the method must raise 
> an INDEX_SIZE_ERR exception." - shouldn't infinite/NaN be handled with 
> NOT_SUPPORTED_ERR, for consistency with every other method? If so, that 
> case shouldn't need mentioning here, since it's implicitly handled by 
> "Common conformance requirements for APIs exposed to JavaScript".

Oops, I forgot about the part that says "Unless otherwise stated, for 
the 2D context interface, any method call with a numeric argument whose 
value is infinite or a NaN value must be ignored", so the "common 
conformance requirements" section is not relevant, and the exception 
behaviour does indeed need to be explicit for (get|create)ImageData.

But why does putImageData throw an exception? It doesn't have a return 
value, so the call could just be ignored (to be consistent with almost 
all other void canvas methods).

-- 
Philip Taylor
pjt47@cam.ac.uk
Received on Sunday, 4 May 2008 21:57:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:17 GMT