I have several hundred "row" elements like this:
<div class='row'>
<div class='cell'></div>
<div class='cell'></div>
<div class='cell'></div>
</div>
I need to get their clientHeight after they have been rendered on the page already. I know that the "clientHeight" property forces a reflow and this kills my performance since there are so many of them. However - they are already rendered and I know that their size doesn't change between the time they are rendered and the time that I query for their height.
Is there a way to tell the browser to NOT reflow when querying for the height ? Moreover - the webkit inspector says:
Layout tree size 5901
Layout scope Whole document
And the divs are within an absolutely positioned ancestor - shouldn't only the absolutely positioned element be reflowed?
Edit:
So the answers provided are correct. I was in fact dirtying the layout because I had this loop:
rows.each(function(){
$(this).css('height', this.clientHeight);
});
Changing the code to this fixed the problem:
var heights = rows.map(function(){
return this.clientHeight;
});
rows.each(function(){
$(this).css('height', heights.shift());
});