W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2010

Re: DOMString-like objects for the CSSOM

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 19 Feb 2010 11:24:55 -0500
Message-ID: <4B7EBB57.3080608@mit.edu>
To: "Mark S. Miller" <erights@google.com>
CC: "public-script-coord@w3.org" <public-script-coord@w3.org>
On 2/19/10 11:20 AM, Mark S. Miller wrote:
> Is it a string right now? If it is...

Yes, it is.  Anne said so in the original post in this thread.  You did 
read that post, yes?

>       So if we want to allow doing |foo.style.top.px = 200|
> Why would you want that?

Because string-to-number and number-to-string conversions are expensive. 
  Right now, moving things around via style.top/left involves two such 
conversions on every set: number to string in the JS and then string to 
number in the C++.  This is showing up as a significant performance cost 
on web sites.  So there needs to be an API that allows setting numbers 

The idea of hanging that API off the existing .top and .left is 
appealing in an API design sense.

> I suggest that once you appreciate the costs of
> that desire, you will no longer want that.

What are the costs, exactly?

Received on Friday, 19 February 2010 16:25:29 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:02 UTC