W3C home > Mailing lists > Public > www-style@w3.org > November 2011

Re: [css21] Revising the definition of the 'inherit' keyword

From: Anton Prowse <prowse@moonhenge.net>
Date: Sun, 27 Nov 2011 21:13:11 +0100
Message-ID: <4ED299D7.30608@moonhenge.net>
To: "www-style@w3.org" <www-style@w3.org>
CC: "Tab Atkins Jr." <jackalmage@gmail.com>
On 23/11/2011 01:11, Tab Atkins Jr. wrote:

>> * Tab Atkins Jr. wrote:
>>> Sveral telcons ago we discussed the definition of the 'inherit'
>>> keyword in the 2.1 spec, and agreed to change it to be better in line
>>> with what CSS3 Cascade says.  Here's my attempted edit:

> 6.1.1 old text:
>
> 1. If the cascade results in a value, use it.
> 2. Otherwise, if the property is inherited and the element is not the
> root of the document tree, use the computed value of the parent
> element.
> 3. Otherwise use the property's initial value. The initial value of
> each property is indicated in the property's definition.
>
> Proposed 6.1.1 new text:
>
> 1. If the cascade results in a value other than 'inherit', use it.
> 2. Otherwise, if the property is inherited or the cascade resulted in
> the value 'inherit', and the element is not the root of the document
> tree, use the computed value of the parent element.
> 3. (unchanged)
>
>
> 6.2.1 old text:
>
> Each property may also have a cascaded value of 'inherit', which means
> that, for a given element, the property takes the same specified value
> as the property for the element's parent. The 'inherit' value can be
> used to enforce inheritance of values, and it can also be used on
> properties that are not normally inherited.
>
> Proposes 6.2.1 new text:
>
> Each property may have a cascaded value of 'inherit', which means
> that, for a given element, the specified value of the property is the
> computed value of the property on the element's parent.  If 'inherit'
> is given as a value to a shorthand property, it has the same effect as
> specifying 'inherit' for all of the longhand properties that the
> shorthand represents (even if the combined computed values of the
> longhand properties end up being an invalid value for the shorthand).
>
> These changes have two effects.  First, they make 'inherit' disappear
> by specified-value time.

I think I prefer the wording in the Errata list[1], although yours is 
equivalent.

(For the benefit of others following this: I think the potted history of 
'inherit' that I pulled together in [2] remains accurate.  As I argued 
there, the current spec wording is sloppy because it uses "value" where 
it should use "computed value"... but that happens all over the place in 
CSS21.  It seems like there's sufficient momentum to improve this 
instance, though, which is perfectly reasonable given that it's a 
definition.)

Don't forget to address √ėyvind's issue in [3]!

> Second, they make the effect of 'inherit' on
> shorthand properties explicit in the same way that !important
> declarations are treated.

Yes, this part is interesting.  It seems like a reasonable approach.

[1] http://www.w3.org/Style/css2-updates/REC-CSS2-20110607-errata.html
[2] http://lists.w3.org/Archives/Public/www-style/2011May/0473.html
[3] http://lists.w3.org/Archives/Public/www-style/2011Oct/0474.html

Cheers,
Anton Prowse
http://dev.moonhenge.net
Received on Sunday, 27 November 2011 20:13:53 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:46 GMT