W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2009

[whatwg] Reliably Minimize Reflows

From: Joseph Pecoraro <joepeck02@gmail.com>
Date: Sat, 26 Sep 2009 16:11:05 -0400
Message-ID: <19E3EB5F-F484-475A-B2A7-2A6F86702EC2@gmail.com>
>> // Single reflow would be triggered at the end of batchUpdate
>> document.batchUpdate(function() {
>> ...
>> });
>
> As a UA developer, I'd not be all that happy implementing this,  
> since you can stay inside the batchUpdate more or less forever (e.g.  
> by putting up alerts or doing sync XHR).
>
> In any case, it seems unnecessary.

I was aware of the potential for a thread to sit inside a  
batchUpdate.  I guess the basic idea would have been that batchUpdate  
would be a hint to the UA. However, I can't think of any other  
situations where there are API functions that are "hints" so maybe  
this isn't appropriate for a spec?


>> "Browsers may choose to wait until the end of a script thread before
>> reflowing to show the changes. Opera will wait until enough changes  
>> have
>> been made, enough time has elapsed, or the end of the thread is  
>> reached.
>> This means that if the changes happen quickly enough in the same  
>> thread,
>> they may only produce one reflow. However, this cannot be relied on,
>> especially considering the various different speeds of devices that
>> Opera runs on."
>
> Note that Gecko will not perform layout while your script is  
> running, unless you ask for layout information.  If Opera has a  
> different behavior, I assume they have a good reason for it, right?   
> Why are you sure you want to override that reason?

I don't think of this as overriding any reasons/behaviors. I thought  
that this would do more to justify those reasons/behaviors.

- Joe
Received on Saturday, 26 September 2009 13:11:05 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:52 UTC