3 ms·
document.createDocumentFragment() https://developer.mozilla.org/en/docs/Web/API/Document/createDocumentFragment https://developer.mozilla.org/en/docs/Web/API/D
by rabelrabel 11y ago
document.createDocumentFragment()
https://developer.mozilla.org/en/docs/Web/API/Document/createDocumentFragment https://developer.mozilla.org/en/docs/Web/API/Document/creat...
- amelius 11y agoThe documentation says this is faster because the browser does not have to compute reflow during DOM construction. But is this also true if the DOM tree is built "bottom up" (i.e., first the leaves, then their parents, etc, and then finally hook everything into the document body)?
- rabelrabel 11y agoOnly one reflow calc at fragment hookup as opposed to a reflow for every child node added to the main DOM.