Slide 22
Slide 22 text
Layout
Avoid Layout Thrashing
JavaScript Paint Layers
Style
for (let i = 0; i < paragraphs.length; i++) {
const h1Width = h1.offsetWidth;
paragraphs[i].style.width = h1Width + "px";
}
Forced Synchronous Layout
Forced Synchronous Layout happens when the code force the browser to
read and write repeatedly so with every read after write we will need to
rebuild the layout to get the accurate reading.