[webkit-dev] CSS properties vs. their JS bindings on the style object

tomz at codeaurora.org tomz at codeaurora.org
Tue Feb 28 21:48:25 PST 2012


Yeah, but how many people really use this "Trident" thing  ;)

Seriously, I'm not sure how to proceed on this.  It does seem to be
outside the spec.  Humorously, even Microsoft's has references that imply
that the script binding is named differently from the CSS attribute.

http://msdn.microsoft.com/en-us/library/ie/ms530759%28v=vs.85%29.aspx

It seems wrong to support methods that are redundant, won't reliably work
on other browsers, and also aren't part of the supported specification.

By the way, could someone confirm whether or not
http://www.w3.org/TR/DOM-Level-2-Style/css is the right reference to be
citing?

Thanks for any guidance,
--Tom

> See also this thread:
> <http://lists.w3.org/Archives/Public/www-style/2012Feb/0655.html>
>
> Apparently this pattern works in Trident.
>
> Simon
>
> On Feb 28, 2012, at 5:14 PM, Simon Fraser wrote:
>
>> Yes, of which there is plenty.
>>
>> Simon
>>
>> On Feb 28, 2012, at 5:10 PM, Eric Seidel wrote:
>>
>>> It would have to be WebKit-only content, correct?
>>>
>>> On Tue, Feb 28, 2012 at 5:04 PM, Simon Fraser <simon.fraser at apple.com>
>>> wrote:
>>> On Feb 28, 2012, at 5:00 PM, Tom Zakrajsek wrote:
>>>
>>>> While investigating https://bugs.webkit.org/show_bug.cgi?id=77427,
>>>> Dave and I have been trekking through the bindings code.
>>>>
>>>> Multiword CSS property names are hyphen-delimited and lower-case,
>>>> while the equivalent JS binding names are camel-case.  In the
>>>> implementation, our binding code is actually adding both forms.
>>>>
>>>> document.body.style["fontSize"] works, but so does
>>>> document.body.style["font-size"]
>>>>
>>>> The presence of the ["font-size"] form in the bindings was called out
>>>> as erroneous (not mentioned in the spec).  It's also not recognized by
>>>> FF or Opera.  Is there any backwards compatibility issue we might not
>>>> be aware of for why the style object has both bindings in WebKit?
>>>> Example
>>>>
>>>> CSS	{ font-size : sSize }
>>>> Scripting           	[ sSize = ] object.style.fontSize
>>>> Thanks,
>>>> --Tom
>>>
>>> I would expect that changing this is pretty likely to break content in
>>> the wild.
>>>
>>> Simon
>>
>> _______________________________________________
>> webkit-dev mailing list
>> webkit-dev at lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>




More information about the webkit-dev mailing list