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

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

From: Glenn Adams <glenn@skynav.com>
Date: Wed, 15 Feb 2012 14:57:43 -0700
Message-ID: <CACQ=j+frP=YrmrxqLZ6FYxmcta3NUMv3-wVi02di-uubR-k3Wg@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: www-style list <www-style@w3.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:50 GMT