[whatwg] [Canvas] Behavior on non-invertable CTM

Ian Hickson ian at hixie.ch
Tue Jul 23 14:11:10 PDT 2013


On Mon, 22 Jul 2013, Dirk Schulze wrote:
> > 
> > scale(0) is invalid, and should throw an exception.
> 
> I don't think that we want to throw an exception on scale(0). No browser 
> does that today. WebKit did it in some places in the past but removed 
> the exceptions.

WebIDL says it should throw a TypeError, because it's missing an argument. 
(Step 4 of the overload resolution algorithm). Firefox, Chrome, and Safari 
all seem to do this.


> >> The second does setTransform(0,0,0,0,0,0), which should reset the CTM 
> >> to a zero matrix (again, not invertible). IE, Opera and FF draw a 
> >> line to 0,0 and close the path afterwards (which kind of makes sense, 
> >> since the universe is convoluted to one point). WebKit refuses the 
> >> lineTo command and closes the path as expected.
> > 
> > WebKit seems to just be wrong here, and the others right.
> 
> Since this is not written in the spec

As far as I can tell, it _is_ written in the spec. scale(0,0) would reduce 
all coordinates and lines and so forth to 0,0. That's what the spec 
requires. I don't see the problem here.

-- 
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