W3C home > Mailing lists > Public > www-svg@w3.org > January 2011

Re: extra commas in path data

From: Dirk Schulze <vbs85@gmx.de>
Date: Sun, 30 Jan 2011 08:52:43 +0100
Cc: ddailey <ddailey@zoominternet.net>, www-svg@w3.org, Robert Longson <longsonr@gmail.com>
Message-Id: <823C31F0-63D1-4DD4-8025-047D53417763@gmx.de>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
Hi,

> On 1/29/11 10:02 PM, ddailey wrote:
>> At http://www.w3.org/TR/SVG/paths.html#PathDataGeneralInformation, the
>> spec says "Superfluous white space and separators such as commas can be
>> eliminated."
> 
> That's eliminated while _authoring_ a path (as in, you don't have to put them in), not while _parsing_ it.  The spec doesn't say anything about allowing authors to insert extra commas, on the other hand...
> 
> -Boris
> 

the BNF of Path indeed looks like this:
drawto-command wsp* drawto-commands
moveto-drawto-command-group wsp* moveto-drawto-command-groups
so Opera and WebKit are wrong. Even if it is no problem to fix this in WebKit, wouldn't it make more sense to allow commas after a command sequence? The BNF could look like this:

svg-path:
    wsp* moveto-drawto-command-groups? wsp-opt-comma*
moveto-drawto-command-groups:
    moveto-drawto-command-group
    | moveto-drawto-command-group wsp-opt-comma* moveto-drawto-command-groups
moveto-drawto-command-group:
    moveto wsp-opt-comma* drawto-commands?
drawto-commands:
    drawto-command
    | drawto-command wsp-opt-comma* drawto-commands

...

wsp-opt-comma:
    wsp* comma? wsp*

This means M 336,325  ,  , Q 251,325  251,292 would be supported as well. In other words: skip all white spaces and commas up to the next character.

Cheers,
Dirk
Received on Sunday, 30 January 2011 07:53:20 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:47 GMT