[whatwg] createImageData should take unsigned long

Ian Hickson ian at hixie.ch
Sun Aug 30 23:08:05 PDT 2009


On Mon, 24 Aug 2009, Philip Jägenstedt wrote:
>
> As far as I can see there's no good reason why createImageData should 
> take a float as input rather than unsigned long. Having it as float 
> creates the odd situation where (0.1, 0.1) gives a 1x1 ImageData while 
> (10.1, 10.1) gives a 10x10 or 11x11 depening on if you ceil or round the 
> input (not defined). Unless there's a compelling reason to allow 
> something like (0.1, 0.1) I suggest changing the type and leaving the 
> float->unsigned conversion to WebIDL.

Twenty years from now, when we're using 960dpi screens, 1 CSS pixel might 
well map to ten device pixels reliably, such that people will want 
sub-CSS-pixel-level accuracy in their calls to createImageData().

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


More information about the whatwg mailing list