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:39:27 -0700
Message-ID: <CACQ=j+cgphGA0HqafPZk7Pu-RHSEguM+Za7pd9+Vt28d9xem-g@mail.gmail.com>
To: Brian Manthos <brianman@microsoft.com>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, "www-style@w3.org" <www-style@w3.org>
On Wed, Feb 1, 2012 at 2:04 PM, Brian Manthos <brianman@microsoft.com>wrote:

>    ****
>
>  ** **
>
>  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?****
>
> ** **
>
> ** **
>
> I think about this from the standpoint of available values, before I worry
> about length.****
>
> ** **
>
> Example A****
>
> <div style=”border: red dashed 1px;”>****
>
> Example B****
>
> <div style=”border-color: red; border-style: solid; border-width: 2px;”>**
> **
>
> ** **
>
> ** **
>
> JavaScript then queries…****
>
> **1.       **document.getElementsByTagName(‘div’)[0].style.border****
>
> **2.       **document.getElementsByTagName(‘div’)[0].style.border-color***
> *
>
> ** **
>
> I would argue that the answers should be…****
>
> A1           “red dashed 1px”****
>
> A2           “red”****
>
> B1           “red dashed 1px”****
>
> B2           “red”
>

This is consistent if the goal is to provide the most information possible
in the most flexible form, while ignoring statements like [1] (emphasis
added):

"The style IDL attribute must return a
CSSStyleDeclaration<http://dev.w3.org/html5/spec/Overview.html#cssstyledeclaration>
whose
value represents the declarations specified in the attribute, if present."

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

One could also argue that these answers are not strictly ignoring this
statement, but rather reading "represents" and "specified in the attribute"
in a flexible manner.


>
> My impression is that some would argue the answers should be…****
>
> A1           “red dashed 1px”****
>
> A2           “”****
>
> B1           “”****
>
> B2           “red”
>

This is consistent with [1] if one uses a strict interpretation of the
declarations specified in the attribute.


>
>
> I think rejecting A2 and B1 like that is both surprising to authors and
> presents either constraints on future shorthanding or incompatibilities
> when they are introduced.
>

I'd like to hear from others on this issue, but this may prove sufficient
to adopt the more flexible approach of your first set of answers. It would
be nice to elaborate this possible shortcomings in more detail to help
convince us that this is the best approach.
Received on Wednesday, 1 February 2012 21:40:15 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:50 GMT