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

On Wed, 15 Feb 2012 21:10:10 +0100, 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.
>
> 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.

https://dvcs.w3.org/hg/csswg/rev/19cb06f0d5fb

I specified this since it seems like the shortest path to interop for  
Gecko to implement it.


I'm happy to revert this change if WebKit/Blink/Trident drop support.

As for Web compat, I see one instance in webdevdata.org's 2012 dec data:

el.style['overflow-y'] = 'hidden';

There might be more cases where the property is in a variable, or in  
external scripts, etc. However, Gecko and Presto not supporting this  
indicates it's not a big Web compat problem to not support it.

-- 
Simon Pieters
Opera Software

Received on Tuesday, 4 June 2013 19:45:13 UTC