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

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

> On 2/15/12 4:57 PM, Glenn Adams wrote:
>
>>    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.
>>
>> 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]
>>
>
> No, it's not.  If you actually look at the link, the property is called
> "cssFloat" in CSS2Properties, both in CSSOM and in the DOM 2 Style specs,
> because "float" is a reserved word in many languages.  Using style.cssFloat
> works in all browsers.
>
>
>  while the first behavior is consistent with the treatment of item() as an
>> ArrayClass.
>>
>
> Uh... no, it's not.  We're not using integer indices here.
>
>
>  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"?)
>>
>
> I'm not sure what you mean by "latter" and "former" here.  My two examples
> both demonstrate the exact same behavior.  The only question is whether the
> spec should spec this behavior or whether Trident and WebKit are willing to
> drop it.


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?

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?

Received on Wednesday, 15 February 2012 22:38:29 UTC