title: How can I trigger CSS layout recalculation after Javascript DOM updates?
body: <p>I often find that if I create or reparent DOM nodes in javascript, the CSS engine doesn't recalculate the sizes of the parent containers. This happens in Firefox and Chrome.</p>
  
  <p>For example, the <code>body</code> might stay the same size while new content overflows the bottom. If I resize the window the body grows, but it doesn't "lock in" to its correct size until the window is sized to be <em>at least</em> as big as the <code>body</code> should be.</p>
  
  <p>Is there a way to trigger a full layout recomputation in Javascript?</p>