You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-color-5] Serialization of percentages and out-of-range alpha in relative colors does not match WPT or implementations #14949
§ Serializing Relative Color Functions disagrees with WPT, and with what browsers do, about how the declared value of the channel and alpha arguments is serialized.
The spec says:
"numbers and percentages serializing as numbers"
the alpha component uses "the same rules as the color channel arguments, but clamped"
The tests expect percentages to stay percentages, and out-of-range alpha to stay unclamped:
The same file also expects out-of-range alpha such as / 500 and / -500 to be preserved.
On wpt.fyi (experimental runs of 4 December 2026: Chrome 161, Firefox 164, Safari 257 preview), all three pass all of alpha-color-parsing-valid, and pass the percentage and out-of-range alpha subtests of color-valid-relative-color.
CSS Color 4 says an out-of-range <alpha-value> is clamped at parse time, so the declared value is clamped, except inside calc(). The current relative color text is consistent with that.
Options:
Change the spec to match implementations: serialize channel and alpha arguments as specified (percentages as percentages), without clamping alpha.
Keep the spec, change the tests, and ask implementations to change.
Activity