Re: [svgwg] SVG2 path data coordinates are currently spec'd as integers.

Well my validator accepted your three lime paths and rejected your red ones.

I then grabbed all 120 paths from the w3c list (thanks for pointing me at that) and all are accepted, except two occurrences of `"M 20 100 H 40#90"` in `paths-data-18-f.svg` and these five from `paths-data-20-f.svg`:
```
M280,120 h25 a25,25 0 6 0 -25,25 z
M360,120 h-25 a25,25 0 1 -1 25,25 z
M200,200 h-25 a25,2501 025,-25 z
M280,200 h25 a25 25 0 1 7 -25 -25 z
M360,200 h-25 a25,25 0 -1 0 25,-25 z
```
which are your three red paths, plus two more. (I also found your lime paths in `paths-data-20-f.svg`.) 

I haven't looked to see if I'm passing something that should fail, but all those failures look legit. 

Things that aren't tested include: decimals, any form of exponent, leading plus signs and negative arc radii. (I get that negative arc radii are permitted in practice. The lack of tests is probably why. And our aim, for the time being, is to recreate what the original authors intended.)

I would have wanted to see more tests like this:
```
M
M0
M0,0
M0,0,0
M0,0,0,0
L0,0
M0.0.0
M0.0.0.
M,0,0 
```

The particular problem with `flag` is it requires context sensitive tokenisation. Encounter a digit and you don't know whether it's the start of a number or the start of a flag unless you know where you are in the grammar.  I would have wanted to fix that, but clearly it can't be altered.

It's not an issue of character budget, either. Or, at least, it could be fixed without making pathdata longer. But, in defence of the original authors, they weren't the ones who deleted the API that we use to parse paths. 

The comment about commas was an aside about human psychology. I have exactly the same flaw: I cling to the need for commas even as I see they are pointless. Compare `"M1,1,1,0"` and `"M,,0,0"` -- something is "missing" in the latter.

-- 
GitHub Notification of comment by fuchsia
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/335#issuecomment-320233349 using your GitHub account

Received on Friday, 4 August 2017 12:12:21 UTC