[csswg-drafts] [css-syntax-3] Inconsistency in defining <number-token> (#7247)

tshinnic has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-syntax-3] Inconsistency in defining <number-token> ==
I believe the correct parsing of real numbers as specified by the [railroad diagram](https://www.w3.org/TR/css-syntax-3/#number-token-diagram) is *not* implemented by the prose sections describing number parsing.

Specifically, it appears sections [4.3.12. Consume a number](https://www.w3.org/TR/css-syntax-3/#consume-number) and [4.3.13. Convert a string to a number](https://www.w3.org/TR/css-syntax-3/#convert-string-to-number) will allow "-E7" as a number.

This would conflict with the railroad diagram which requires *something* between sign and 'E'. It also seemingly conflicts with the spec's hyper-rigidity where "1.E1" is disallowed. (#3599)

(BTW: am I correct that that railroad diagram was copied from an older SVG spec?)

.
Once again I was trying to find the definition for SVG real numbers and the chain of refs led me to CSS Syntax. Specifically I was trying to find the 'rightness' of an emitted "9e-5" or "-1e-4".

I find section [&lt;number-token> under 4.1. Token Railroad Diagrams](https://www.w3.org/TR/css-syntax-3/#number-token-diagram) and say "yay, I'm right!"

Then I find section [4.3.12. Consume a number](https://www.w3.org/TR/css-syntax-3/#consume-number) and am dismayed. Then I realized that spec was merely confusing and did allow for "9e-5". Then it seemed it was so loose as to allow for gibberish - no number at all!

I checked section [4.3.13. Convert a string to a number](https://www.w3.org/TR/css-syntax-3/#convert-string-to-number) figuring it would restrict further. But like 4.3.12 so many of the parts are optional, there is little in the way of a minimal content required.

Was it intended to allow "E99" as a &lt;number-token>?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7247 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 3 May 2022 03:43:51 UTC