javascript performance: repaint and reflow