For example, if I do something like
requestAnimationFrame(function() {
el.appendChild(otherEl)
el.appendChild(anotherEl)
anotherEl.removeChild(someOtherEl)
anotherEl.appendChild(yetAnotherEl)
})
Does that cause a (synchronous?) repaint/reflow to happen during the time when we're trying to avoid causing repaint/reflow, thus voiding the purpose of requestAnimationFrame
?
Or, will the browser be smart and wait until after that frame is complete (after all those DOM manipulations are complete) in order to finally paint the resulting DOM structure?
What are all the things that can cause repaints/reflows, and that we would want to avoid doing while inside a requestAnimationFrame?
The list of styles in this html5rocks article mention only style that (I think) cause repaint/reflow when they are modified. I'm also curious to know which JavaScript properties (and on which object they are on) cause reflow when being accessed (i.e. reflow happens in order to be able to get the value of a certain property).