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

Simon Fraser simon.fraser at apple.com
Tue Feb 28 17:04:39 PST 2012


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120228/d47f6ecb/attachment.html>


More information about the webkit-dev mailing list