Re: DOMString-like objects for the CSSOM

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