W3C home > Mailing lists > Public > www-dom@w3.org > January to March 1999

DOM2 CSS: Shorthand Properties, again

From: L. David Baron <dbaron@fas.harvard.edu>
Date: Thu, 4 Mar 1999 14:07:09 -0500 (EST)
Message-Id: <199903041907.OAA00069@login6.fas.harvard.edu>
To: www-dom@w3.org
Now that I have seen the new draft [1], I have a few more comments on
shorthand properties (see [2] for previous discussion).

I'll start with the minor point.  Where you say (at the end of the 4th
paragraph of Interface CSS2Properties [3]):

  (the normals are initial values, and are implied by use of the
  longhand property).

the word "longhand" should, I think, be replaced by "shorthand."
Perhaps the sentence should be changed to be "... implied by *setting*
the shorthand property," since they are not implied by querying it.

Also, these rules for querying priorities should apply not only to the
CSS2Properties interface, but also to the CSSStyleDeclaration interface
[4] (methods getPropertyValue and setProperty).  Perhaps they are
better defined in CSSStyleDeclaration.  This would probably be clearer
since the rules for setting and querying would be defined separately.
Furthermore, these two methods are already defined to be equivalent to
setting/querying an attribute for CSS2Properties.  CSS2Properties
should probably have the definition that getting/setting is equivalent
to getPropertyValue and setProperty, and leave it at that.

Furthermore, you should also define exactly how setting an attribute of
CSS2Properties is equivalent to setProperty.  That is, you should
either define it so that it is equivalent to calling setProperty with
the priority from getPropertyPriority or with the priority "" (probably
the former).

Finally, how should removeProperty [5] handle shorthand properties?
Perhaps it should remove all the longhand properties that are changed
by setting the shorthand property, but only if it is possible to add a
shorthand property to the ruleset without changing the current rules
(since otherwise it would be impossible to return a value correctly).
The shortest such shorthand value would be the value returned (just as
for getPropertyValue).

I think this is better than requiring that shorthand properties have
been set explicitly in shorthand form, because I don't think
implementations should be required to store whether properties were set
in their shorthand form or longhand form.

Note that this means that font-stretch and font-size-adjust are removed
by setting the font property, but they wouldn't appear in the return
value.  An alternate solution would be to say that that the shorthand
property would also have to completely express the current rules that
are to be removed, or else it would not be removed.  This would mean
that if fontStretch or fontSizeAdjust had been set, then
removeProperty("font") wouldn't do anything.  Or should removeProperty
just not do anything for shorthand properties because it is hard to
make a coherent system to handle removing them?

David Baron

[1] http://www.w3.org/TR/1999/WD-DOM-Level-2-19990304/
[2] http://lists.w3.org/Archives/Public/www-dom/1999JanMar/0054.html
[3] http://www.w3.org/TR/1999/WD-DOM-Level-2-19990304/css.html#Level2-CSS-CSS2Properties
[4] http://www.w3.org/TR/1999/WD-DOM-Level-2-19990304/css.html#Level2-CSS-CSSStyleDeclaration
[5] http://www.w3.org/TR/1999/WD-DOM-Level-2-19990304/css.html#Level2-CSS-CSSStyleDeclaration-removeProperty

L. David Baron    Freshman, Harvard    dbaron@fas.harvard.edu
Links, SatPix, CSS, etc.  < http://www.fas.harvard.edu/~dbaron/ >
WSP CSS AC                < http://www.webstandards.org/css/ >
Received on Thursday, 4 March 1999 14:07:18 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:05 UTC