Browser Internals7h estimated

The Critical Rendering Path

Difficulty
Importance

The problem

Getting pixels on screen involves several expensive sequential stages, and understanding that sequence — and which stages a given code change actually triggers — is what separates a page that feels instant from one that stutters on every interaction.

Why now

HTML parsing/render tree and the CSS box model each covered one stage of getting pixels on screen; this topic assembles them into the full pipeline (parse, style, layout, paint, composite) and shows which stages a change to the page forces the browser to redo.

Mental model

Every visual change re-runs some suffix of a fixed pipeline: changing layout-affecting properties (width) reruns layout, paint, and composite; changing paint-only properties (background-color) skips layout; changing only compositor properties (transform, opacity) skips both — which is exactly why animating transform is fast and animating width is slow.

Requires

Used in

Projects

  • Use the DevTools Performance panel to record a page interaction and identify which stages (layout, paint, composite) were triggered
  • Animate the same visual effect two ways — changing width/top versus transform — and compare frame rate and pipeline stages triggered

Examples

  • Animating transform: translateX() skips layout and paint entirely, running only on the compositor thread for a smooth 60fps
  • Animating left or width forces layout recalculation on every frame, often dropping well below 60fps

Resources

Mastery checklist