I have recently watched a video of Nicholas Zakas talk about high performace scripts. This one is about reflow and repaint. he says it\'s bad to constantly reflow which is m
When thinking about creating a copy of the DOM, the following methods can be useful:
These methods are very useful for DOM structures, but unfortunately, they do not return useful values for dimensions.
The elements have to be rendered. This can be done by creating an <iframe> element, and insert the document (nodes) in it. The previously mentioned methods can be used for this purpose: Create an effective copy of (part of) the document, and insert the document into the iframe.
It might be useful to also insert a <base> element in the <head>, so that URLs and images are correctly resolved.