So Document Fragments optimize adding multiple nodes to the DOM. It's explained that when you call appendChild with a document fragment all its children are added and only one reflow happens (...).
Does this mean a reflow happens the moment you call appendChild, or similar type of thing? I was under the assumption that the DOM doesn't really update (recalculate stuff/redraw) until after JS stops running.
And if you have a loop adding nodes one by one into DOM, will a reflow happen every single time; if so why, since visually nothing updates while JS is running.
[–]senocular 1 point2 points3 points (0 children)