avoid reflows by using a DocumentFragment