Re: canvas: globalAlpha should not throw

On Wed, 10 Jun 2009 08:16:16 +0200, Ian Hickson <ian@hixie.ch> wrote:

> On Tue, 19 May 2009, Simon Pieters wrote:
>>
>> The spec doesn't call out NaN and Infinity for globalAlpha. I think
>> globalAlpha should be handled consistently with the other canvas
>> attributes and not throw an exception.
>>
>> http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalalpha
>
> The spec 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.
>
> ...and doesn't appear to contradict this in the definition of  
> globalAlpha.
> Am I missing something?

2.2.3 Common conformance requirements for APIs exposed to JavaScript says  
to throw NOT_SUPPORTED_ERR.

Since the spec says whether to throw or not for everything *but*  
globalAlpha for the 2d context, the spec would be clearer if the part you  
quoted was zapped and that you call out anything that's different from  
2.2.3. The spec is hard to follow when there are different "unless  
otherwise stated" for different parts of the spec.

-- 
Simon Pieters
Opera Software

Received on Wednesday, 10 June 2009 09:31:17 UTC