-
Notifications
You must be signed in to change notification settings - Fork 654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-color-4] Clarify how color() values with fallback should serialize #5904
Comments
You are right, this is not covered at all, and should be, explicitly, not just as an example. In general, the design principles for
So it seems therefore that the serialized form, in the case of fallback, should be serialization as-is except for the various normalizations. Does that seem reasonable? (Note to self to make sure Typed OM also handles fallback colors on the Also btw your example is incorrect, it should either be color(display-p3 0 1 0, rgb(0 100% 0)) using the legacy syntax as a fallback, or color(display-p3 0 1 0, color(srgb 0 1 0)) using another color function as a fallback. Note that in this second case, the fallback could itself have a fallback. Here is an example: color(rec2020 0 0 1, color(display-p3 0.119 0 0.415, rgb(14.1% 0% 43.8%))) |
Thanks for the details, I'm just starting to look into fallback now, so haven't really studied this part of the spec yet. There are a few examples that don't seem to match this pattern like Example 40 in https://drafts.csswg.org/css-color-4/#color-function.
|
Yeah, that makes sense to me. |
The syntax is supposed to be this: color() = color( [ [<ident> | <dashed-ident>] [ <number-percentage>+ | <string> ] [ / <alpha-value> ]? ]# , <color>? ) where "Each argument represents either an invalid color, as described below, or a valid color", so color(prophoto-rgb 0.4835 0.9167 0.2188, display-p3 0.3499 0.9800 0.1399, rgb(33.44% 96.68% 21.07%)) seems correct. If it is not, then the above grammar should be modified as well. Also, the current one probably meant: color() = color( [ [<ident> | <dashed-ident>] [ <number-percentage>+ | <string> ] [ / <alpha-value> ]? ]# [, <color>]? ) |
I guess one other thing that would be good to call out is how are things like the following (taken from wpt predefined-014.html) serialized:
That is, an invalid color (invalid because it is non-dashed ident representing a color space that isn't predefined) with a valid fallback color. Similarly, explicitly codifying how something like the following serializes would be helpful:
That is, an invalid color (invalid because there is no (Note, Example 19 makes it clear how this would serialize if there was a specified |
(No action pending resolution of #5931 which would make this one moot) |
Closed because the |
It is not clear to me from the wording how
color()
values with fallback (e.g.color(display-p3 0 1 0, srgb 0 1 0)
) should be serialized. It would be good to at least have an example, if not explicitly call it out.The text was updated successfully, but these errors were encountered: