I need to do heavy DOM manipulations on the whole document of webpages in an Add-On I write. I would like to minimize the reflows so only one reflow happens for all my manipulations. Removing the body element, doing the manipulations and then inserting it again is not an option because this reevaluates all <script>
elements. Currently I set visibility of the body to 'none'
before the manipulations and restore the value of display after. I'm not sure if this is teh best way to deal with this, though.
Is there a better way? Of course it could be Firefox/Mozilla specific code. After all it's a Firefox Add-On.