[csswg-drafts] [css-color-5] RCS channel keywords interaction with calc() is underspecified (#10280)

weinig has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-color-5] RCS channel keywords interaction with calc() is underspecified ==
The behavior of the RCS channel keywords and calc() is underspecified in a few ways.

1. It is unclear when the keyword should resolve to their numeric values. 

CSS Values 4 requires specifications, like CSS Color 5, that define additional keywords for calc, to include the following:

> Each specifications defining such keywords must define for each keyword:
>
> - its value
> - its [type](https://drafts.csswg.org/css-values-4/#determine-the-type-of-a-calculation) ([`<number>`](https://drafts.csswg.org/css-values-4/#number-value), [`<length>`](https://drafts.csswg.org/css-values-4/#length-value), etc)
> - when it resolves (parse time, computed-value time, or used-value time)

(https://drafts.csswg.org/css-values-4/#calc-variables)

CSS Color 5 does do the first two.

The answer here will depend on if the origin is `currentcolor`, as in that case, the specified value serialization could not be the numeric value, but in the general case, it's still unclear. Should the specified value serialization of `color(from blue srgb calc(r) calc(g) calc(b))`  be `color(from blue srgb calc(r) calc(g) calc(b))` or `color(from blue srgb 0 0 1)`?  

2. It is unclear what to do about missing components in the origin color.

For example, take: `color(from color(srgb none none none) srgb r calc(g) calc(b * 2))`.

How should this be interpreted? 

Should the none be carried forward for the bare identifier but not calc?: `color(srgb none 0 0)`
Should the none be carried forward for the bare identifier and calc? If so, what is `none * 2` evaluate to?

An additional edge case to consider and clarify is for when the alpha value of the origin color is used as the default: `color(from color(srgb none none none / none) srgb 0 0 0)`

Should that resolve to `color(srgb 0 0 0 / none)`?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10280 using your GitHub account


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

Received on Saturday, 4 May 2024 18:53:10 UTC