Re: [css21] The 'inherit' keyword in shorthand properties

On Mon, Jan 2, 2012 at 7:17 AM, Anton Prowse <prowse@moonhenge.net> wrote:
> I take it back; I believe my claim and comments *do* stand, and that this
> problem is just a special case of the fact that value assignment on
> shorthand properties is not well-defined.  (Apologies for my wavering; I
> blame it on the abrupt end of the holiday season!)
>
> It's often the lack of an obvious /computed/ value for shorthand properties
> that alert us to the wider problem of value assignment on shorthand
> properties, but in this case we see the lack of a /specified/ value for
> shorthand properties.  The proposal wouldn't provide this value.
>
> Unfortunately, I can't see that it would be any easier to solve this special
> case with an alternative proposal than it would be to solve the general
> problem.  Nonetheless, I've tracked this issue separately at
> https://www.w3.org/Bugs/Public/show_bug.cgi?id=15387 with references to the
> general problem.

No, it's still a different case.

In general, shorthand value assignment is defined "well enough".  They
have a grammar, and we handwave that values are assigned appropriately
from what you provide.  Aside from the odd ambiguity caused by mashing
together multiple properties (which we solve on a case-by-case basis)
this is unambiguous and fine.

Passing 'inherit' or 'initial', though, doesn't work with the above.
For one, it's fully ambiguous, as it can come from any of the
properties.  For two, we explicitly forbid passing 'inherit' or
'initial' multiple times, or as a part of a shorthand while other
parts are filled in, even if it would be unambiguous to do so.  Those
two keywords are explicitly a special case that cannot be handled by
the general language that we normally rely on successfully for
shorthands.

The specified value of a shorthand is well-defined in the general
case; it's what was specified.  'inherit' and 'initial' are special
because they disappear before the specified-value stage, which is why
we need the special text for them - their normal effects don't work,
as shorthands have neither initial nor computed values.

~TJ

Received on Monday, 2 January 2012 20:21:42 UTC