views:

29

answers:

1

From page Javascript, is there any way to know when a Webkit-based browser (particularly interested in recent Chrome, but a generic solution would be nice) has finished drawing the page, and/or has finished resolving all styles? Mozilla browsers have the MozAfterPaint event that's quite handy for this sort of thing.

A: 

I think you can do it by using JavaScript to query a property which depends on all element having been placed: for example, get the object property whose value is the location of the last element on the DOM.

ChrisW
Thanks, I'll try that.
Zack
It turns out that that's not the same thing. Webkit (and Gecko too) can unblock Javascript that's waiting for location properties after they *position* everything, which happens well before they actually *draw* everything.
Zack