Re: [csswg-drafts] [css-images] Typos gradient grammars (#6425)

> but currently two or more stops (#) are required:

`#` does not imply two or more, it implies one or more, same as `+`. It just requires a comma between the repetitions, while `+` doesn't require anything.

> This behavior is not defined but with the current grammars for a color stop list, they assume that when parsing a color stop with two positions, the input list of component values is mutated by pushing a comma and the color between the two positions.

The serialization rules for the gradient functions aren't strictly defined, but the behavior is sensical - giving two positions is defined to be equivalent to providing two color stops with the same color:

> A [color stop](https://w3c.github.io/csswg-drafts/css-images-4/#color-stop) with two positions is equivalent to specifying two color stops with the same color, one for each position.

So browsers are just expanding it into two stops internally, and then serializing them individually rather than re-merging them.

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


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

Received on Tuesday, 22 November 2022 21:30:54 UTC