Re: [svgwg] Floating point number format discordance (SVG vs CSS vs browsers)

> But, throwing crazy at the wall, finding some way of using the CSS parser on pathdata would simplify the maintenance of SVG. Pulling apart tokens is one possibility. But maybe the CSS parser needs to grow an entry point for consuming pathdata.

That entry point would basically be a completely separate parser. CSS text is tokenized, then parsed into structures. Pathdata is fundamentally incompatible with CSS tokenization rules.

I do want to have a version of pathdata that's compatible with CSS; the current approach means that the CSS `path()` function has to literally take a string, like `path("M0,0H10")`, to avoid it getting parsed all wonky. But that would mean a grammar that would not be compatible with current pathdata in the wild. (It would almost certainly be a subset of the current pathdata grammar, but a lot of optimizations that today's tooling does to the value would no longer be allowed.)

(If that pathdata above was passed to CSS literally, like `path(M0,0H10)`, that would parse as an ident token with the value `M0`, a comma token, then a dimension with the value 0 and the unit `H10`.)

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

Received on Tuesday, 24 October 2017 23:08:43 UTC