The Rendering Engine: Layout, Paint, Compositing
20 min read
BlinkWebKitReflowRepaintCompositingGPU Accelerationwill-change
Inside the Rendering Engine
After the Render Tree is built: Layout → Paint → Composite turns it into pixels.
Layout (Reflow)
Calculates exact size and position. Changing one element can affect children, siblings, and parents. Triggered by: width, height, margin, padding, font-size, window resize.
Paint
Fills visual details: backgrounds, borders, text, shadows. Operations are per-layer.
Compositing
GPU assembles painted layers. Elements with transform, opacity, will-change get their own compositor layer.
The 60fps Budget
60fps = 16.67ms per frame for: JavaScript → Style → Layout → Paint → Composite
Rendering Engines
| Engine | Browser |
|---|---|
| Blink | Chrome, Edge, Opera |
| WebKit | Safari (all iOS browsers) |
| Gecko | Firefox |