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

Scientific notation has been removed from the path EBNF #286

Closed
nical opened this issue Sep 28, 2016 · 10 comments
Closed

Scientific notation has been removed from the path EBNF #286

nical opened this issue Sep 28, 2016 · 10 comments

Comments

@nical
Copy link

nical commented Sep 28, 2016

In the path specification, the BNF has been simplified this commit: 7cce3e3

In the process, the numbers in the paths lost support for the scientific notation (for example 2e-4) Which is surprising to me. It looks like it was not intentional.

@nical nical changed the title Scientific notation has been removed from the path BNF Scientific notation has been removed from the path EBNF Sep 28, 2016
@nical
Copy link
Author

nical commented Sep 28, 2016

cc @AmeliaBR (you authored the commit 7cce3e3 which removed support for the scientific notation in the path spec). The commit message is not mentioning this change, is it intentional?

@AmeliaBR
Copy link
Contributor

That commit was me copying over @nikosandronikos's changes from 77ee738 and previous commits.

However, I am fairly confident that you are correct, @nical, and that this was an unintentional change.

As you noted in bodoni/svg#3, scientific notation has been problematic when trying to convert SVG to be more compatible with CSS. But my understanding was that it would continue to be valid in attributes. However, I now don't see any references to it in the Data Types chapter.

Does anyone else remember a specific decision to remove support for scientific notation? That would be a major breaking change!

@tabatkins
Copy link
Member

CSS added scientific notation (in part, to be more compatible with SVG) some time ago as well.

@AmeliaBR
Copy link
Contributor

@tabatkins OK, great, so in that case it's covered by the general <number> (or <length>, etc) data type in SVG. Which explains why we no longer have specific text about it in the SVG Data Types chapter.

But since the path data uses a non-CSS parser, we need to re-define it there, too.

Basically, this line number ::= ([0-9])+, should instead be something like

number ::= ([0-9])+((e|E)sign?([0-9])+)?

@nikosandronikos Can you confirm whether that's correct for the grammar? If so, we probably can make a resolution to correct it at this week's telcon.

@nikosandronikos
Copy link
Member

In terms of the path syntax, the scientific notation should be there and it's a mistake that it was removed. I'll add it back in next week. I don't think we need a resolution on this.

@nikosandronikos
Copy link
Member

On a side note. I don't really like having the path syntax grammar in the spec at all. Compared to describing the syntax in prose, which is simple, the grammar is very complicated and hard to test.

@AmeliaBR
Copy link
Contributor

Related conversation on www-svg

The initial "bug" mentioned by the poster is not a bug, just one of the quirky features of the path data. But then later the actual bug (that is the subject of this issue) was noted: as currently written in SVG 2, "number" is defined only as integers.

@boggydigital
Copy link
Contributor

Not blocking updated 2.0 CR publication - assigning 2.1 WD milestone

@dirkschulze
Copy link
Contributor

@ericwilligers I am assigning this one to you. Would you please look at the issue noted by @AmeliaBR in
#286 (comment) ?

@dirkschulze
Copy link
Contributor

Fixed by #697

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment