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

On Wed, Feb 15, 2012 at 1:10 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> Apparently Trident (including in standards mode) and WebKit support
> properties on their CSSDeclaration objects whose names are property names.
>  Presto and Gecko do not.
>

You are speaking of CSSStyleDeclaration, correct?


>
> What this means is that something like this:
>
>  document.body.style["font-**size"] = "20px"
>
> works in Trident and WebKit but not in Presto and Gecko.  Worse yet,
> something like this:
>
>  document.getElementById("**something").style.float = "right"
>
> works in Trident and WebKit but not in Presto and Gecko.
>
> Seems to me like this behavior should be either dropped or specified. I'm
> assuming for now that it's intentional and hence chances of the former are
> nil, but please do tell me if I'm wrong.


Perhaps I'm missing something here, but clearly the second of the above is
consistent with the behavior defined by CSS2Properties as well as what has
been drafted at CSSOM [1], while the first behavior is consistent with the
treatment of item() as an ArrayClass.

[1] http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface

I agree that this latter behavior is not currently specified, and does need
to be in CSSOM. What is the specific problem with the former? (is it
related to the use of "cssFloat" vs "float"?)

Received on Wednesday, 15 February 2012 21:58:31 UTC