Rendering Pipeline

Browser Rendering Pipeline (Critical Rendering Path)

Avoid 60fps-killing main-thread reflows by targeting compositor-only properties—every geometric DOM write forces Style, Layout, Paint, and Composite to re-run.

About this page
READ
2 min
Interactive Simulator

Frame Execution in Blink (16.6 ms at 60 Hz)

Observe which pipeline phases activate depending on the mutation type.

JS
Style
Layout
Paint
Composite
Step 1 / 4: 1. JS Mutation (width)

Script sets el.style.width = '320px'. The node is marked dirty for Style and Layout.

card.style.width = '320px';
Internal State / Memory
dirtyFlags
STYLE | LAYOUT | PAINT
mainThread
Blocked
compositorThread
Waiting
Frame Execution in Blink (16.6 ms at 60 Hz)

Under the Hood#

Blink executes frame rendering as a strict unidirectional pipeline from Style through Layout, Paint, Layerize, and Composite. Modifying geometry at Layout invalidates every downstream stage, whereas mutating transform or opacity updates a GPU compositor matrix directly without re-running Style, Layout, or Paint.

  1. Style (Recalc Style): Blink matches every node from DOM & CSSOM Construction against CSSOM rules (governed by CSS Cascade Layers) and computes resolved ComputedStyle values (unless skipped offscreen via content-visibility).
  2. Layout (Reflow): The engine computes exact geometry (boxes, x/y coordinates, widths, heights) in the LayoutTree.
  3. Paint: Emits a list of draw instructions (DisplayItems: backgrounds, borders, glyphs) sorted by CSS Stacking Context, without rasterizing yet.
  4. Composite: The Compositor Thread splits GPU Compositor Layers into tiles, rasterizes them on GPU, and applies transform / opacity without blocking the main thread.
CSS
/* Triggers Layout -> Paint -> Composite (expensive on main thread) */
.drawer.open {
  left: 0;
  width: 320px;
}

/* Skips Layout and Paint; runs on Compositor Thread */
.drawer-fast.open {
  transform: translate3d(0, 0, 0);
}
Mutated PropertyTriggered PhasesMain Thread Cost
width / top / marginStyle -> Layout -> Paint -> CompositeHigh
background-color / box-shadowStyle -> Paint -> CompositeMedium
transform / opacityComposite only (if promoted layer)Near zero

Problem Genealogy#

  • 1999 (DOM Level 1): Every DOM read/write triggers synchronous recalculations on a single thread, an architecture designed for static hypertext, later abused for interactive apps.
  • 2008 (Hardware Acceleration): Separation of the Compositor Thread to animate scrolling and transforms off the main thread.
  • 2021+ (RenderingNG): Modular pipeline architecture isolating each phase for parallel GPU rasterization.

Production Pitfalls#

  • Layout Thrashing: Reading element.offsetHeight immediately after writing element.style.width inside a for loop forces a synchronous Layout on every iteration, turning a 16 ms frame budget into a 200 ms stall.
  • Layer Explosion: Applying will-change: transform to hundreds of nodes exhausts mobile GPU VRAM and crashes tabs.

Where this connects

Prerequisites

Rendering Pipeline

DOM & CSSOM Construction

Style calculation requires parsed DOM and CSSOM trees before constructing the render tree.

Next & related

Rendering Pipeline

CSS Houdini @property

Type registration changes how the Style phase parses and interpolates custom properties.

Rendering Pipeline

Render Tree & Layout

Layout is the geometry-solving stage inside the main-thread frame pipeline.

State & Architecture

Virtualized Lists & Windowing

Rendering 10,000+ DOM nodes chokes style recalculation and layout passes; windowing caps active nodes.

Mechanical Comparisons