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 13:50:40 -0700
Message-ID: <CACQ=j+dgqk=BeM6unoXPkTYkbytBzbQe5+_CnnL2vVOV=Ggh0g@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: www-style@w3.org
On Wed, Feb 1, 2012 at 1:15 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 2/1/12 3:06 PM, Glenn Adams wrote:
> The DOM2 Style text is basically nuts.  I wouldn't worry too much about it.

It's what it is, and gives some ideas about original intent, whether it was
implemented that way or not. I don't mind diverging from or changing the
intent if there is consensus to do so.

> We should make the CSSOM ED say whatever the right behavior is.  First we
> need to decide on that behavior.


>   1. On query operations (e.g., getting cssText, length, invoking item,
>>    getPropertyValue, etc.), does ElementCSSInlineStyle.style represent
>>    *only* the declarative content of @style? *OR*
>>  2. On query operations, does ElementCSSInlineStyle.style represent the
>>    UA's so-called "specified values" [1] state of all properties that
>>    do or could apply to the element? i.e., the results of applying the
>>    cascading and inheritance steps of the property resolution process?
> Depending on what you mean by "declarative content", the aswer is either
> #1 or "neither".

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.

If we give priority to that declarative content, then it may argue for
having length/item match only those declarations returned by cssText.
However, if we give priority to the UA's state, then it may permit that
them not to match (e.g., due to shorthand expansion). Further, if we adopt
the latter, then the question remains as to whether the queried values
should in any way reflect the cascading or inheritance process. For
example, say we have:

<body style="border-width: 1px">
<div style="border-top-width: 2px">

then is {div}.style.cssText =>
"border-top-width: 2px; border-right-width: 1px; border-bottom-width: 1px;
border-left-width: 1px;"
[i.e., cssText returns corresponding longhand components with cascading and
inheritance having been applied]

or is {div}.style.cssText =>
"border-top-width: 2px;"
[i.e., cssText returns longhand components without cascade/inheritance]

>  [Is there an implied
>>    delay before acting on this trigger, e.g., in order to coalesce
>>    multiple mutations? Or does each mutation require serialized and
>>    distinct re-resolution and reformatting?]
> Is this observable?

just asking the question of whether there should be a documented
expectation about presence or absence of such behavior; at the (video)
frame level, it could be observable; it could be observable in performance
or interleaving of  the effects of mutation;

>   6. Do the length and item() members of the CSSStyleDeclaration instance
>>    referenced by *ElementCSSInlineStyle.style represent only* the
>>    declarations present in cssText or not? If not, then what exactly do
>>    they represent? Longhand equivalents only? Longhand equivalents plus
>>    shorthand?
> This is what we need to decide, yes.

so which of these do you think is the right answer?
Received on Wednesday, 1 February 2012 20:51:29 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 16:28:38 UTC