batch dom rendering to prevent layout trashing