Re: [csswg-drafts] [color-5] Serialization of percentages in color-mix() (#8564)

We have a failure on a specific test caused by an edge-case of the spec:

`color-mix(in srgb, 70% red, 50% blue)` from
 https://github.com/web-platform-tests/wpt/blob/master/css/css-color/parsing/color-valid-color-mix-function.html#L20

From the instructions in the spec, the percentage specified for the second color is not included following the `unless either that is 50%` rule, resulting in `color-mix(in srgb, red 70%, blue)`

A similar situation can occur with the first percentage, like in `color-mix(in srgb, 50% red, 70% blue)`. The `50%` for the first color would not be included following the `unless either that is 50%` rule, resulting then as `color-mix(in srgb, red, blue 70%)`.

A possible wording for the spec that would resolve the issue would be:

```
The serialization of the specified value of a ''color-mix()'' function
is the string "color-mix(in ",
followed by the specified <<color-space>> in all-lowercase,
followed by ", ",
followed by the first specified color,
followed by a space,
followed by the specified (un-normalized) first percentage (unless both percentages are 50%),
followed by ", ",
followed by the second specified color,
followed by the specified (un-normalized) second percentage (unless the two specified percentages add to 100%),
followed by ")".
```

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


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

Received on Tuesday, 22 August 2023 18:42:08 UTC