W3C home > Mailing lists > Public > public-html@w3.org > June 2008

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

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 12 Jun 2008 22:49:17 +0000 (UTC)
To: Mihai Sucan <mihai.sucan@gmail.com>
Cc: public-html <public-html@w3.org>
Message-ID: <Pine.LNX.4.62.0806122247460.8559@hixie.dreamhostps.com>

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

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:44:32 UTC