[csswg-drafts] [css-ui] Computed value of currentColor

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

== [css-ui] Computed value of currentColor ==
[css-ui-3 defines the computed value of caret-color this 
way](https://drafts.csswg.org/css-ui-3/#propdef-caret-color):

> The computed value for auto is auto. For <color> values, the 
computed value is as defined for the [CSS3COLOR] color property.

The intent was (among other things) to have `currentColor` compute to 
`currentColor` as a keyword, but it is not clear if this wording is 
good to unambiguously define it that way.

In 
[css-color-3](https://drafts.csswg.org/css-color-3/#currentColor-def),
 we're told that:
> The used value of the ‘currentColor’ keyword is the computed value 
of the ‘color’ property. If the ‘currentColor’ keyword is set on the 
‘color’ property itself, it is treated as ‘color: inherit’. 

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 the `color` property, `currentColor` has been replaced with 
the computed value of the `color` 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` on 
`caret-color` to “be treated as inherit”, but it would be possible to 
read it as `currentColor` being replaced by an actual color value at 
computed value time. Given that `caret-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](https://drafts.csswg.org/css-color/#currentcolor-color). It 
says the following about currentColor:
> if the value is inherited, it’s inherited as currentcolor, not as 
the value of the color property, so descendants will use their own 
color property to resolve it.

Since the intended meaning in css-ui-3 and the meaning inferred by 
color-4 agree: `currentColor` should computed to `currentColor` as a 
keyword. I suggest making this unambiguous in css-ui-3 by changing the
 Computed Value entry in the propdef table to:

> The computed value for auto is auto, and for currentColor is 
currentColor. For other <color> values, the computed value is as 
defined for the color property. 


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

Received on Monday, 21 November 2016 01:11:10 UTC