You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I'm currently writing a parser for SVG path data, I'm able to provide a new pair of eyes for the new grammar definition introduced in SVG 2. Disclaimer: I'm not a grammar specialist, but I did study those things at University a few years back, so hopefully I'm not too rusty.
I am now reasonably familiar with the original SVG 1.1 grammar:
Overall, I think the SVG 2 draft grammar reads much better than the SVG 1.1 grammar, thank you for that! I may suggest minor tweaks later to improve readability, but for now a more serious issue. I think the following:
elliptical_arc_argument::=
number comma_wsp? number comma_wsp? number comma_wsp
flag comma_wsp? flag comma_wsp? coordinate_pair
should be:
elliptical_arc_argument::=
number comma_wsp? number comma_wsp? coordinate comma_wsp
flag comma_wsp? flag comma_wsp? coordinate_pair
In other words, the third parameter of an arc should be coordinate rather than number (it can be negative). The original SVG 1.1 grammar was the following:
elliptical-arc-argument:
nonnegative-number comma-wsp? nonnegative-number comma-wsp?
number comma-wsp flag comma-wsp? flag comma-wsp? coordinate-pair
This seems an unintentional mistake, as I haven't seen this discussed, but maybe I missed it.
Cheers,
Boris
The text was updated successfully, but these errors were encountered:
(Note that in SVG 1.1 grammar, "number" means "signed number", while in the SVG 2 draft it means "unsigned number", which may have contributed to the confusion)
The third value of arc represents a rotation angle, so there's no logical reason why it can't be negative. And a quick test in all the browsers I had easy access to shows that they accept it.
So I agree, this was probably an accidental oversight when renaming the grammar syntax tokens.
Hi everyone,
As I'm currently writing a parser for SVG path data, I'm able to provide a new pair of eyes for the new grammar definition introduced in SVG 2. Disclaimer: I'm not a grammar specialist, but I did study those things at University a few years back, so hopefully I'm not too rusty.
I am now reasonably familiar with the original SVG 1.1 grammar:
https://www.w3.org/TR/SVG11/paths.html#PathDataBNF
The one currently drafted in:
https://svgwg.org/svg2-draft/paths.html#PathDataBNF
And I have read the following threads to get a sense of the history and rationale of some of the modifications:
#335
#331
#286
#325
Overall, I think the SVG 2 draft grammar reads much better than the SVG 1.1 grammar, thank you for that! I may suggest minor tweaks later to improve readability, but for now a more serious issue. I think the following:
should be:
In other words, the third parameter of an arc should be
coordinate
rather thannumber
(it can be negative). The original SVG 1.1 grammar was the following:This seems an unintentional mistake, as I haven't seen this discussed, but maybe I missed it.
Cheers,
Boris
The text was updated successfully, but these errors were encountered: