Re: [csswg-drafts] [css-transforms-1] Browsers do not implement transform attribute syntax as described by w3c

If you use the CSS parser, but impose the optional-comma rule from SVG, and don't then take special care to *require* whitespace between tokens, then something like `translate(5-5)` will indeed work just fine - the `5-5` part is tokenized into two `<number-token>`s.

(That is to say, if you just parse it as if the CSS grammar is `translate(<number> ,? <number>)`, you'll get this result.  Note that `translate(5px-5px)` will *not* parse correctly - this results in a single `<dimension-token>` with a value of `5` and a unit of `px-5px`.)

If you want to disallow this, you need to impose a manual restriction requiring whitespace between the numeric tokens, similar to what `calc()` requires around its `+` and `-` operators.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2623#issuecomment-385273729 using your GitHub account

Received on Sunday, 29 April 2018 19:07:15 UTC