Re: [csswg-drafts] "Can't be displayed" is undefined (#5046)

After discussing this with @svgeesus, it seems that there's a bunch of things we need to decide about `color()` fallbacks and validity before we serialize to spec prose.

- If a `color()` specifies an invalid color but its fallback is valid, is the `color()` call valid? It seems like it should be, as this is how `var()` fallbacks work, but we need to resolve.
- It is currently specified that if a color space is not supported, the color is invalid. However, if the color space is a `<dashed-ident>`, the color should be *invalid at computed value time*, since the color space may always be loaded later. Keyword-defined color spaces can be invalid at parse time, which means their fallbacks can be provided via the cascade.
- If the `<dashed-ident>` color space **is** available, but the arguments are incorrect, the color should still be invalid at computed value time, because the `@color-profile` rule can always be removed and replaced with a different one, for which the arguments are valid. Contrary, for a keyword color space, the validity of the arguments is known at parse time.
- If the fallback applies *both* when the (`<dashed-ident>`) color space is not available *and* when the color is out of the screen gamut, how do you reasonably provide separate fallbacks for these two cases? I imagine the fallback one may want to provide could be significantly different for manual gamut mapping or for an undefined color space. For example, if the color space is unavailable, the fallback *must* be in a different color space. Whereas, if the color space is available but the color is out of gamut, the fallback could still be in the same color space, just with different arguments.
- Similarly, if the fallback is applied in both cases, how does one specify that if the color is OOG they want to use the browser's built-in gamut mapping, but still provide a fallback if the color space is not available? Would it be useful to have the ability to specify separate fallbacks? 
- I wonder if it would be best to provide a media query or other type of conditional to check if a color space is available?
- How does one provide a fallback to `lch()`? It's not available as a predefined color space on `color()`, and the `lch()` function doesn't have a fallback parameter. I suppose it's possible via `color(--nonexistent, lch(...), fallback)` but that's clunky (and depends on having multiple fallbacks, which I'm not convinced we need). Then again, perhaps the [`in-gamut` MQ](https://github.com/w3c/csswg-drafts/issues/5045) can resolve these cases.


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


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

Received on Wednesday, 16 September 2020 15:15:13 UTC