-
Notifications
You must be signed in to change notification settings - Fork 707
[css-ui] Computed value of currentColor #741
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
Agenda+. I expect this to be completely uncontroversial, but it is a change to a CR, so a group decision is warranted. |
WG was in favor of this, but wanted a better wording that could more easily be reused across specs that have the same issue. That wording should be anchored on definitions / alogrithms / rules / etc found in level 3 of the color spec. If necessary (e.g. the wording we want is in level 4 or not written yet) we can make errata to color 3. |
The idea is some simple algorithm that can be invoked akin to the "lengths made absolute" wording used by tons of properties with inherited lengths, so we don't have to call out special cases in every single property that uses colors. |
AFAIK, the closest we have now is the second sentence of https://drafts.csswg.org/css-color-4/#currentcolor-color |
That simple algorithm should probably also be the place where we put the answer to #480. Don't know if the level 3 version of that algo should do that much or if that should be left to level 4, but that seems like the right hook. |
I've made a tentative pull request to add the the anchoring terminology and definition in #871 |
As discussed at the Seattle F2F, there is some overlap between https://drafts.csswg.org/cssom/#serialize-a-css-component-value and the definition introduced by #871. #871 is more specific / clear about which color should resolve to what at what time, but cssom is more specific about how to serialize the various functions once you've decided to do that. Fixing this redundancy by having css-color-4 just keep the high level logic, and defer to cssom for the string level details of how to serialize the value does not seem particularly good to me, as presumably the new functions added to css-color-4 (and later) will have their serialization in css-color-4 (and later), and then you need to look up to multiple specs to have the full picture. What I think would be nicer is:
The remaining question is then how to port that back to css-color-3, which I think we need to for two reasons:
The easiest way to do that is to duplicate the level 4 definition, simply omitting references to notations that don't yet exist in level 3. But I am not sure what that means in terms of process. Is an errata enough? do we need to cycle back to CR/PR/REC? Errata sound sufficient for correcting the serialization, but not for introducing the new anchor terminology. |
On further toughts, and having checked https://www.w3.org/2013/09/normative-references, I don't think the referencing problem is actually a problem. Yes, css-color-4 is much less mature than css-color-3, but the rules about normative references do not forbid it, and given the guidelines it spells out for evaluating whether a dependency is ok or not, we can easily make the case that it is fine. So, since #871 has been merged and the relevant part of it ( I'll close this issue with a commit doing just that, and move the rest of the previous comment to a separate issue. |
…for caret-color Relates to #741: same ambiguity on a different property
css-ui-3 defines the computed value of caret-color this way:
The intent was (among other things) to have
currentColor
compute tocurrentColor
as a keyword, but it is not clear if this wording is good to unambiguously define it that way.In css-color-3, we're told that:
The first sentence says that
currentColor
is resolved at used value time, which implies that it stays as a keyword at computed value time. “treated as” in the second sentence implies that at computed value time on thecolor
property,currentColor
has been replaced with the computed value of thecolor
property on the parent element.Despite the fact that CSS-UI invokes the computed value logic of the color property, it wouldn't make much sense for
currentColor
oncaret-color
to “be treated as inherit”, but it would be possible to read it ascurrentColor
being replaced by an actual color value at computed value time. Given thatcaret-color
is an inherited property, this would lead to a different (undesirable) behavior than preserving it as a keyword at computed value time.css-color-4 also agrees. It says the following about currentColor:
Since the intended meaning in css-ui-3 and the meaning inferred by color-4 agree:
currentColor
should computed tocurrentColor
as a keyword. I suggest making this unambiguous in css-ui-3 by changing the Computed Value entry in the propdef table to:The text was updated successfully, but these errors were encountered: