[whatwg] HTMLMediaElement.volume

Maciej Stachowiak wrote:
> 
> On Jun 1, 2007, at 6:03 PM, Ian Hickson wrote:
> 
>> On Fri, 23 Mar 2007, Anne van Kesteren wrote:
>>>
>>> Wouldn't it be better if no INDEX_SIZE_ERR was raised but instead the
>>> previous value was retained? For consistency with
>>> CanvasRenderingContext2D.globalAlpha for instance. It's not really
>>> important, but I think that some consistency between the various APIs
>>> would be nice.
>>
>> In general, actually, raising INDEX_SIZE_ERR is what the APIs do. So for
>> consistency, volume is correct.
>>
>> globalAlpha, though, is not. What do people think? Should we change the
>> canvas globalAlpha attribute to raise an exception for out-of-range
>> values? Any browser vendors have an opinion?

What about INDEX_RANGE_ERR ?
This name is explicit, and consistent with INDEX_SIZE_ERR.

> In general I prefer silent failure to exceptions, since JS exceptions 
> tend to lead to catastrophic failure of a whole script and thus tend to 
> turn slight implementation differences (possibly misreading the spec in 
> some cases) into serious compatibility issues.

Although I also like silent failure, I tend to think it leads to more 
flamboyant failures of scripts. Having the spec. push exceptions 
will/should make for solid and error proof JavaScript code.



Regards,


-- 
Mathieu 'p01' HENRI
JavaScript developer, Opera Software ASA

Received on Monday, 4 June 2007 05:37:20 UTC