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 
directly.

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?

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

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:02 UTC