Re: Canvas ImageData comments

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 UTC