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

On 2/1/12 4:26 PM, Glenn Adams wrote:
> 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.

OK.  I don't think that's a useful concept for thinking about .length 
and .item on a CSSStyleDeclaration, then.

>     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?

No, it's the number of longhand properties set by that shorthand.

-Boris

Received on Wednesday, 1 February 2012 21:31:16 UTC