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

Re: [css3-values] RE: CSSStyleDeclaration#length and shorthands.

From: Glenn Adams <glenn@skynav.com>
Date: Wed, 1 Feb 2012 14:26:19 -0700
Message-ID: <CACQ=j+d7mL0wQRPsS5uKGdgPmqyihsekosicQw6tr=QxNUoBcA@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: www-style@w3.org
On Wed, Feb 1, 2012 at 2:01 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 2/1/12 3:50 PM, Glenn Adams wrote:
>> By "declarative content" I mean the value returned by cssText, i.e., the
>> CSS declaration block decoded from or encoded into the value of @style.
> Those are different things.  The cssText is a string, but the declaration
> block is an object.  You can have lots of "equivalent" declaration blocks
> with slightly different initial text representations...

I am using "declaration block" in the sense defined by CSS2.1 [1] here,
which corresponds to the value of the cssText property as opposed to an
CSSStyleDeclaration instance.

[1] http://www.w3.org/TR/CSS2/syndata.html#rule-sets

The style attribute's value is defined at [2].

[2] http://dev.w3.org/csswg/css-style-attr/#syntax

This also corresponds to the language in HTML5 [3]:

"The style IDL attribute must return a
value represents the declarations specified in the attribute, if present."

[3] http://dev.w3.org/html5/spec/Overview.html#the-style-attribute

it could be observable in
>> performance or interleaving of  the effects of mutation;
> I'm not sure what you mean.  Example, please?

let's drop that sub-thread for now

>  so which of these do you think is the right answer?
> I already said that earlier in this thread: I think length() should return
> the number of longhand properties that are set in the declaration and
> item() should iterate the longhand properties.  That's a simple behavior to
> define (modulo the fact that the current CSS spec has no actual concept of
> "set in the declaration").  The only drawback is forward-compat as
> properties that used to be longhands become shorthands....

So, if cssText returns only a shorthand, then is length 0?
Received on Wednesday, 1 February 2012 21:27:07 UTC

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