Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decimal point not allowed according to Path Data ENBF #926

Closed
waruyama opened this issue Nov 21, 2023 · 3 comments
Closed

Decimal point not allowed according to Path Data ENBF #926

waruyama opened this issue Nov 21, 2023 · 3 comments

Comments

@waruyama
Copy link

Either I am completely missing something, or the ENBF for a coordinate in path data does not allow decimal points.

Here is the relevant part of the SVG 2.0 spec:
https://www.w3.org/TR/SVG2/paths.html#PathDataBNF

According to this a coordinate can only consist of digits with an optional leading sign. This is the ENBF for a coordinate as written in the spec:

coordinate::= sign? number

sign::= "+"|"-"
number ::= ([0-9])+

The correct definition for number (to allow numbers like "0.3", ".3", "3.") must probably look like this:

number ::= ([0-9]+ "."? [0-9]* | "." [0-9]+)
@dalboris
Copy link

Indeed, and also things like 1.0e-42 should be allowed too. This was correct in SVG 1.1, see:

https://www.w3.org/TR/SVG11/paths.html#PathDataBNF

I believe the idea is that in SVG 2.0, it should delegate the definition of "number" to CSS.

There are in fact a few other things that were broken when the grammar was rewritten between 1.1 and 2.0, see:

Is there someone on the committee and/or with merge rights that can volunteer to review these changes, integrate them, and close all these related issues? The above PR is a good place to start as it's quite a trivial change: only one line modified. If someone is willing to review and merge PRs, starting with the one above, then I can take the time to volunteer to make other PRs to fix the remaining grammar problems.

@dalboris
Copy link

Also, I just realized that the link you provided is from the W3C Candidate Recommendation of 04 October 2018.

The number syntax has already been fixed since, the latest version ("Editors draft") can be found at this link:

https://svgwg.org/svg2-draft/

Which already contains the following fix to the number grammar:

93c09f1

So I think we can close this specific issue.

@waruyama
Copy link
Author

Sorry for that, the link came up in the Google search when searching for the SVG2 spec and I did not check if it is the current version.

Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants