W3C home > Mailing lists > Public > www-style@w3.org > January 2012

Re: [css21][css3-cascade] Proposal for value assignment to shorthand properties

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Tue, 10 Jan 2012 23:03:19 +0100
To: Anton Prowse <prowse@moonhenge.net>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-ID: <f5cpg75ccrslu8q9a4pi3g3i2v6sl9jibb@hive.bjoern.hoehrmann.de>
* Anton Prowse wrote:
>There are two types of shorthand property in CSS: those which are 
>capable of unambiguously representing all possible combinations of all 
>possible specified values of the corresponding longhand values, and 
>those which are not.  Let's call the former set the "active shorthand 
>properties" and the latter set the "passive shorthand properties".

This seems a mischaracterization to me, for one thing, how shorthands
relate to longhand properties is subject to change. `font` for instance
resets `font-stretch` even though the latter property is not part of
CSS 2.1 but `font` is.

>Do shorthand properties get assigned specified, computed, used and 
>actual values?  Since passive shorthands can't possibly match all 
>combinations of the longhands, I would argue that they should be defined 
>as not having any of these values.  On the other hand, the active 
>shorthands should be assigned these values by merely combining the 
>corresponding values from the longhands.

As I recall it, shorthand properties are a macro mechanism and are ex-
panded in place, DOM Level 2 Style for instance treats them as if they
do not exist at the object model level anymore. Odd cases like system
fonts in the `font` property have been discussed a number of times, I
am not sure if there was any conclusion however. Similarily, there is
a problem when ordinary properties are redefined as shorthands.

>How do the special values 'inherit' and 'initial' fit into this?  Well, 
>we assume that the initial value of a shorthand is always in direct 
>correspondence with the initial values of its longhands.

A shorthand set to either of the values results in setting all the sub-
properties to the same value plus whatever else is required, like re-
setting certain other properties. This should be clear from the syntax
of the shorthand properties, where `inherit` is only allowed as alter-
native for everything else (and the references to longhands do not in-
clude `inherit` as explained in the definition of the notation), but in
CSS 2.1 C.3.1 this is more explicit. As I recall it, `initial` is meant
as alternative wherever `inherit` is allowed and should work the same
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Tuesday, 10 January 2012 22:03:53 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:09 UTC