And, yeah, one thing that drives me mad about the web is that there's no distinct layout phase. You can't requestLayout() like you could on Android. You can't change things around and wait for the next layout pass — every single of your changes gets reflected immediately. Every dang time you change something that might affect layout, the layout gets recalculated, and only then does control return to your JS. You added 100 divs in a loop? It does it for every. single. one.