Re: [canvas] 2d context fillRect() negative values for width/height

On Sun, 9 Mar 2008, Mihai Sucan wrote:
> 
> Working on a canvas painting tool I found that Firefox allows negative 
> values for the width and height arguments of the 
> canvas.2dcontext.fillRect() method. Opera and Safari do not.
> 
> I found this because I considered natural that width/height can be 
> provided as negative values. Looks like the spec does not explicitly 
> define what should happen when negative values for the two arguments are 
> passed. As such, neither of the three browsers violate the spec.

Actually the spec does specify what should happen.


> I would suggest that the spec is updated to allow negative values for 
> the arguments. I have already filled a bug report to Opera requesting 
> that they follow Firefox with regards to this.
> 
> The same story is valid for the clearRect() and the strokeRect() 
> methods.

This is already allowed, since no allowance is made for any unusual 
behaviour for negative values.

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

Received on Thursday, 12 June 2008 22:49:56 UTC