W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2009

[whatwg] CanvasRenderingContext2D.lineTo compatibility problem

From: Oliver Hunt <oliver@apple.com>
Date: Sat, 11 Jul 2009 15:41:38 -0700
Message-ID: <8F741713-57E0-42C7-B7DE-F300E35F73D7@apple.com>
While investigating a compatibility issue with http://www.blahbleh.com/clock.php 
  I found that the spec behaviour on CanvasRenderingContext2D.lineTo  
conflicts with what Gecko implements.

The current spec language is
"The lineTo(x, y) method must do nothing if the context has no  
subpaths. Otherwise, it must connect the last point in the subpath to  
the given point (x, y) using a straight line, and must then add the  
given point (x, y) to the subpath."

Gecko appears to treat the empty path case as moveTo(x,y).  I'm going  
to do a bit more investigation into the behaviour of this and the  
other path manipulation functions to see whether lineTo is "special"  
or this logic effects every function (of course any Gecko devs may be  
able to answer more quickly than i can manually verify).  On the  
*assumption* that my initial analysis is correct i propose that the  
language be updated to something akin to:
The lineTo(x, y) method is equivalent to moveTo(x, y) if the context  
has no subpaths. Otherwise, it must connect the last point in the  
subpath to the given point (x, y) using a straight line, and must then  
add the given point (x, y) to the subpath.

--Oliver
Received on Saturday, 11 July 2009 15:41:38 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:14 UTC