Re: [cssom] Supporting JS properties whose names are CSS property names on CSSDeclaration objects

On 2/15/12 5:37 PM, Glenn Adams wrote:
> OK, just to be clear, your concerns regarding the CSSOM spec are that it
> should either:
>
> (1) explicitly define support for use of the bracket notation for
> property accessors for properties whose name is a style property defined
> by CSSStyleDeclaration
>
> or
>
> (2) explicitly exclude such support

Sure, if you want to think of it that way.

Note that (2) is somewhat difficult to define because sometimes the 
property name and the spec name are in fact the same (e.g. "display"). 
If WebKit and Trident drop their support for this stuff, then I don't 
think we need explicit action to spec (2).  If they don't we probably 
need explicit action to spec (1).

Also note, this is not special to bracket notation.  In Javascript, 
style.float and style["float"] are completely identical; the former is 
just syntactic sugar for the latter.  So style["display"] works in all 
browsers.  style["fontSize"] works in all browsers.  style["cssFloat"] 
works in all browsers.  style["font-size"] or style["float"] do not.

> Is this correct? Do you have a preference?

I'd somewhat prefer (2), obviously, since it's less work for me.  ;)

> Regarding cssFloat vs float, are you suggesting that the spec should
> explicitly exclude the use of float

There is no separate cssFloat vs float issue.  It's the same exact issue 
as the fontSize vs font-size issue.  See above.

-Boris

Received on Wednesday, 15 February 2012 22:46:26 UTC