Re: Is implied lineto after moveto ambiguous?

On Wed, 21 Apr 2010 19:18:52 +0200, Rick <graham.rick@gmail.com> wrote:

> Hello Working Group.
>
> In packing path data for a high traffic web feature, I came across
> what I think is an ambiguity in the spec:
>
> The definition for the moveto command (
> http://www.w3.org/TR/SVG/paths.html#PathDataMovetoCommands ) in path
> is as follows:
>
> --
> Start a new sub-path at the given (x,y) coordinate. M (uppercase)
> indicates that absolute coordinates will follow; m (lowercase)
> indicates that relative coordinates will follow. If a relative moveto
> (m) appears as the first element of the path, then it is treated as a
> pair of absolute coordinates. If a moveto is followed by multiple
> pairs of coordinates, the subsequent pairs are treated as implicit
> lineto commands.
> --

I believe we already have this covered in the SVG 1.1F2 spec:

   http://dev.w3.org/SVG/profiles/1.1F2/publish/paths.html#PathDataMovetoCommands

New spec text is as follows:
[[ Start a new sub-path at the given (x,y) coordinate. M (uppercase)  
indicates that absolute coordinates will follow; m (lowercase) indicates  
that relative coordinates will follow. If a moveto is followed by multiple  
pairs of coordinates, the subsequent pairs are treated as implicit lineto  
commands. Hence, implicit lineto commands will be relative if the moveto  
is relative, and absolute if the moveto is absolute. If a relative moveto  
(m) appears as the first element of the path, then it is treated as a pair  
of absolute coordinates. In this case, subsequent pairs of coordinates are  
treated as relative even though the initial moveto is interpreted as an  
absolute moveto. ]]

...
> I haven't tested browsers, I would be willing to expend the effort if
> any interest is shown.

We have one new test for this spec change, but you are most welcome to do  
further testing (and help us improve the testsuite).

   http://dev.w3.org/SVG/profiles/1.1F2/test/svg/paths-data-16-t.svg

Cheers
/Erik

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed

Received on Wednesday, 21 April 2010 18:47:39 UTC