wpt
wpt copied to clipboard
Color serialization with channel keywords and calc
When specifying a channel keyword in a color there are two methods:
rgb(from red r g b)
and rgb(from red calc(r) calc(g) calc(b))
According to css/css-color-parsing/color-valid-relative-color.html they serialize exactly as specified, so specifying a channel keyword without calc serializes without calc and specifying with calc serializes with calc.
When a calc contains a single numerical value, the calc()
part can be omitted, otherwise it should be serialized with it as per https://drafts.csswg.org/css-values-4/#calc-serialize.
Should these rules apply to channel keywords as well and how would it change the examples I gave?