Bugzilla – Bug 15387
Not clear what 'inherit' on shorthand properties means
Last modified: 2012-12-04 00:52:19 UTC
Reported by Øyvind Stenhaug
The spec is not clear about how a value of 'inherit' on a shorthand property is treated. In particular the proposal in Bug 14420 for defining how 'inherit' is treated doesn't make sense for shorthand properties since it depends on knowing the computed value of the parent's shorthand property, a concept which is not well defined as per Bug 15384 (value assignment on shorthand properties is not well-defined).
It has been proposed to make it explicit in 6.2.1 (The 'inherit' value) [http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit] that setting 'inherit' on a shorthand is equivalent to setting 'inherit' on all the corresponding longhand properties; however, this doesn't actually solve the problem since that's the expected mechanism of shorthand properties in any case.
Rather, this bug is a special case of Bug 15384 in that the specified value of a shorthand property is not well defined in the case that the pre-cascade declared value of the property is 'inherit'.
(In reply to comment #0)
> It has been proposed to make it explicit in 6.2.1 (The 'inherit' value)
> [http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit] that setting
> 'inherit' on a shorthand is equivalent to setting 'inherit' on all the
> corresponding longhand properties;
There was a proposal from Tab, quoted here:
| 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).
The only thing that worries me a little is the "specifying" there, which weakly implies "specified value" (this is silly, but well). I suggest s/specifying/setting/ or s/specifying/giving/ or something else. No strong opinion though.