w3c / svgwg

SVG Working Group specifications
Other
698 stars 132 forks source link

[animations] Invalid value syntax in <control-point> #821

Open pyoor opened 3 years ago

pyoor commented 3 years ago

The spec currently defines the <control-point> syntax as: <number> ,? <number> ,? <number> ,? <number>

https://github.com/w3c/svgwg/blob/693d8cc39144b5208c64c55d459b0db5ac8845c1/specs/animations/master/Overview.html#L1428-L1429

This can be better defined use the hash and curly brace combination defined in CSS Values and Units 3: <number>#{1,4}

https://drafts.csswg.org/css-values-3/#component-multipliers

tabatkins commented 3 years ago

I think you're misreading the grammar - it's not saying each number and its associated comma is optional, it's saying the commas themselves are optional. That is, 0 0 0 0 is valid, as is 0, 0, 0, 0. But 0 0 is invalid, because it needs all four numbers.