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

On 1/31/12 11:40 PM, Glenn Adams wrote:
> Three UAs retain the original cssText, excepting Safari which translates
> to the longhand properties only.

Your test doesn't show that, actually.  What it _does_ show is that at 
least three UAs try to produce shorthands in cssText.

I know for a fact that Gecko does NOT retain the original cssText here. 
  It stores longhands internally, and tries to produce the shortest text 
representation it can for cssText.

The only way to tell what UAs are really doing here is to try multiple 
different values of the original cssText and see what happens to it.  In 
addition to the shorthand you tried, you should also try 
"border-top-width: 2px; border-right-width: 4px; border-bottom-width: 
2px; border-left-width: 4px" (which won't change the output in gecko and 
WebKit; not sure about the others), and perhaps things like 
"border-width: 3px 4px; border-bottom-width: 2px; border-top-width: 2px" 
and so forth....

> Three UAs also report 4 items, including those that return only one shorthand property in cssText.

The only reason Gecko reports more than 4 is that our implementation of 
border-start and border-end involves a few extra longhand properties 
dealing with border widths, and the border-width shorthand sets those 
additional longhand properties.

> There are clearly some interoperability requirements here that need to
> be resolved in both CSSOM and in the UAs.

Yep.

-Boris

Received on Wednesday, 1 February 2012 04:49:46 UTC