Layout Paint and Composite: The Rendering Pipeline
Understand the browser's layout, paint, and composite pipeline to predict style change costs.
The Three Rendering Stages
After the render tree is built, the browser runs three stages: Layout (calculating element sizes and positions), Paint (filling pixels with colors/text/images), and Composite (combining painted layers and displaying them on screen).
Layout (Reflow)
Layout calculates geometry — width, height, x/y position — for every element. Changing properties that affect geometry (width, margin, padding, font-size, position) triggers layout for the element and potentially its entire subtree — the most expensive stage.
All lessons in this course
- Critical CSS and Render Blocking
- Layout Paint and Composite: The Rendering Pipeline
- will-change and Layer Promotion
- CSS Coverage and Unused Styles