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

On Wed, Feb 1, 2012 at 11:47 AM, Brian Manthos <brianman@microsoft.com>wrote:

>
> My (lossy) recollection of my (imperfect) interpretation of the (pre-CR)
> specifications when working on backgrounds and borders for IE9...
>
> a. style.cssText and style.length are related but not directly connected
>

c. style.length refers to the collection of style.foo name-value pairs and
> should be complete and flexible (no coalescing); expected usage is to
> interrogate or set individual longhands or shorthands
>

While (a) and possibly (c) appear to be the case for current
implementations, I'm not sure if this is intended or sanctioned by existing
spec text, either in DOM2 Style or current CSSOM ED. As I pointed out,
there are different uses made of CSSStyleDeclaration that appear to drive
distinct behaviors. For example, the CSSStyleDeclaration returned by
getComputedStyle() is explicitly stated to contain all properties.

In contrast, the text of CSSStyleDeclaration.{length,item} both use the
phrase "explicitly set", and the text around CSSStyleRule and
ElementCSSInlineStyle appear to further scope the usage to "this
declaration block" or "the style attribute", respectively. This does not
read to me as prescribing "complete" in the sense of including longhand
expansions, or other properties, etc.

Clearly we have:

   - the existing specs are ambiguous;
   - this has resulted in significant differences in implementations, and
   possibly differences from the intentions of the published spec text;

To resolve, we will certainly need to elaborate the spec text, and possibly
even change its intention if we determine that existing implementation
behavior should take precedence.

I propose that we first attempt to obtain consensus on the semantics of the
usage of CSSStyleDeclaration found with ElementCSSInlineStyle.style then
move on to other uses. To do this, we need answer (at least) the following
questions:

   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?
   3. On mutation operations (e.g., setting cssText, invoking setProperty,
   etc), does ElementCSSInlineStyle.style represent *only* the declarative
   content of @style? *OR*
   4. *On mutation operations, does ElementCSSInlineStyle.style represent
   the *the UA's "specified values" [1] state of all properties that do or
   could apply to the element?
   5. Does mutation implicitly trigger reapplication of the entire property
   resolution process *and* reformatting? [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?]
   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?

[1] http://www.w3.org/TR/css3-values/#specified

Received on Wednesday, 1 February 2012 20:07:45 UTC