Re: [CSSOM] Revisiting transforms and getBoundingClientRect()

On 9/8/11 12:00 PM, Tab Atkins Jr. wrote:
> On Thu, Sep 8, 2011 at 8:03 AM, John J Barton
> <johnjbarton@johnjbarton.com>  wrote:
>> A list of JS calls that for-sure cause layout and a list that
>> for-sure-do-not would be a good start. Is that possible?
>
> Here is a probably-complete list for Webkit.  Other browsers should be
> similar or identical:
> http://gent.ilcore.com/2011/03/how-not-to-trigger-layout-in-webkit.html

Definitely not identical.  For Gecko, for example, getComputedStyle() 
does not trigger anything, while various getters on the returned object 
may trigger restyles or relayout.

There are also relayout triggers for lots more Window getters 
(innerWidth, etc, etc) at least in Gecko.  Some are relayouts on the 
parent document, though.  I would expect that to be the case in WebKit 
too....

-Boris

Received on Thursday, 8 September 2011 16:07:59 UTC