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

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

From: Brian Manthos <brianman@microsoft.com>
Date: Wed, 1 Feb 2012 21:04:26 +0000
To: Glenn Adams <glenn@skynav.com>, Boris Zbarsky <bzbarsky@mit.edu>
CC: "www-style@w3.org" <www-style@w3.org>
Message-ID: <9710FCC2E88860489239BE0308AC5D170EB30883@TK5EX14MBXC264.redmond.corp.microsoft.com>

 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

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”

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

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.

As I mentioned previously, for cssText I understood the goal to be more minimalistic/concise and thus the coalescing makes sense.
Received on Wednesday, 1 February 2012 21:05:54 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:55 UTC