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

On Wed, Feb 15, 2012 at 2:37 PM, Glenn Adams <glenn@skynav.com> 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
>
> Is this correct? Do you have a preference?

No, I think you're misunderstanding.

Currently, the CSSOM defines that CSSStyleDeclaration has a property
named "fontSize".  WebKit and IE, though, additionally recognize a
property named "font-size", which is treated as an alias.  Same
applies to every other property with a dash in its name.

There's no need to talk about "bracket notation" because that's a
particular way that JS accesses properties on an object, and
irrelevant to the OM.  The issue is about the property names we expose
on the object.

> Regarding cssFloat vs float, are you suggesting that the spec should
> explicitly exclude the use of float, or merely add an informative note
> reminding the implementer/user that the correct name is cssFloat and not
> float?

Same thing.  We need to either get WebKit and IE to change their
implementation to expose only the specced property name ("cssFloat"),
or change the spec to mandate additionally exposing the "float"
property name, treated as an alias.

~TJ

Received on Wednesday, 15 February 2012 22:55:57 UTC