initial, inherit, and shorthands (was Re: Splitting background-position in two different attributes.)

On Thursday 2011-08-18 18:29 +0000, Brian Manthos wrote:
> 'Gecko follows the rule that if some subproperties of a shorthand are inherit or initial, then in order for the shorthand to serialize as other than "", all must be.'
> 
> Actually, wait, that's incorrect.  Sub-values at the "set at
> initial" state are represented by the absence of them in the
> shorthand.

That's only true for a few shorthands; each shorthand is different
in terms of whether parts can be omitted and what happens to those
parts if it's not there.

And in no cases can a part be the 'initial' or 'inherit' keyword.


So, given:
  shorthand: some value;
  longhand-within-shorthand: initial;
one can't make a general statement that it's still possible to
serialize a value of 'shorthand' representing the pair of
declarations.

In Gecko, we use 'initial' as our internal representation (and what
we serialize) only when the 'initial' keyword was used to specify
the value.  For omission within shorthands, I made an explicit
decision *not* to use 'initial' but instead to use the actual
initial value, for the serialization reasons I described.

-David

-- 
π„ž   L. David Baron                         http://dbaron.org/   𝄂
𝄒   Mozilla Corporation               http://www.mozilla.com/   𝄂

Received on Thursday, 18 August 2011 19:52:56 UTC