-
Notifications
You must be signed in to change notification settings - Fork 711
[css-color-adjust] [css-color-adjust] Initial value of the color property. #9274
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
Comments
Wait, can you explain this more? I'm not quite sure I follow your reasoning.
Note that the Color Adjust text is from 2019, predating the commit that changed 'color''s initial value from black to CanvasText which is from 2020. I think you're just getting confused by some dated text, meant to be an override at the time, which should now be removed since the initial value achieves what was intended more directly. |
This is probably an implementation detail (though I recall WebKit working the same way in the past at least?). The way I think this is the only case where
Well the dated text is doing something different from |
One piece of history here might be that the system keywords were specified to compute to themselves at some point, and that the resolved/used value would take color-scheme into account. In that case it would be obvious to me that the root element and first span should have white color and the second span black color. I think the "initial value of the color property" statement predates the CanvasText initial value. This spec text from css-color-adjust also looks like it's assuming system keywords compute to themselves since it's talking about affecting the used value:
In short, I think the Blink behavior makes sense, but we probably need to do some adjustments in the specs. |
Done. |
From CSS Color 4, 14.1. Resolving sRGB values
So, remove this?
|
@emilio all good now? |
@emilio I believe this is all correct now, do you agree? If so the issue can be closed. |
Yes |
Consider this test-case (live):
Browsers disagree on what the behavior is:
CanvasText
.Right now the specs specify neither behavior.
From https://drafts.csswg.org/css-color-4/#the-color-property:
Initial values are generally computed values, which means that you use the default color scheme, which comes from the
<meta name=color-scheme>
tag, absent in this test-case.But then from https://drafts.csswg.org/css-color-adjust/#color-scheme-effect:
Which I understand it as "the second span should still have white text".
Test-case with
<meta name=color-scheme>
here for reference.I think all browser's behavior make some sense in a way, and are reasonably easy to implement (Chromium's behavior seems to be some sort of special-case where they treat
initial
much likeCanvasText
). But the spec behavior is rather weird.I think Chromium's behavior is the most intuitive and would be ok resolving to do that, but happy to hear other opinions.
@lilles it seems this comes from a647cfd which seems directly from your spec draft. Is the spec behavior being different from Chromium's behavior intentional? I'm guessing not? :)
cc: @smfr @jfkthame @svgeesus @tabatkins
The text was updated successfully, but these errors were encountered: