[whatwg] Canvas spec issues

Darin Adler darin at apple.com
Sat May 12 09:21:21 PDT 2007


On May 11, 2007, at 4:18 PM, Ian Hickson wrote:

> On Mon, 26 Mar 2007, Philip Taylor wrote:
>
>> A couple of points that are unclear and are causing differences  
>> between
>> current implementations (which is presumably a bad thing):
>>
>> "interface HTMLCanvasElement" says "attribute long width;". #reflect
>> says "If a reflecting DOM attribute is a signed integer type  
>> (long) then
>> the content attribute must be parsed according to the rules for  
>> parsing
>> signed integers first", which seems to apply in this case. But the
>> canvas section says of width/height, "The rules for parsing non- 
>> negative
>> integers must be used to obtain their numeric values". Hence,  
>> conflict.
>>
>> Also, "canvas.width = -1" is acceptable for a signed long, but  
>> doesn't
>> make sense here. (After setting that, Firefox gives canvas.width==0,
>> Opera gives 300, Safari gives -1.)
>
> Changed to unsigned.

If it's unsigned, it's ambiguous what behavior should be when an  
attempt is made to set the value to a signed value via JavaScript.  
Should an INDEX_SIZE_ERR exception be raised? Should the value be  
ignored?

I think I ran into this problem with HTMLOptionsCollection length  
property.

     -- Darin




More information about the whatwg mailing list