4 ms·
One related thing that's caused me some grief is that in Chrome, the cost of a layout is O(n) in the number of hidden elements; so if there's a large number of
by jimrandomh 11y ago
One related thing that's caused me some grief is that in Chrome, the cost of a layout is O(n) in the number of hidden elements; so if there's a large number of DOM nodes hidden inside a node with display:none, they still slow down reflows.
- paulirish 11y agoSomewhat. "Reflow" is typically what we call forced 1) Style Recalc and 2) Layout. Any hidden DOM elements have zero cost during Layout, as they are absent in the LayoutTree. However they can contribute to recalc, just while the browser confirms that they are still display:none.