The Runtime Theory
ClientFoundationsexecution

Trace a Browser Rendering a Page

Follow a browser from receiving HTML through DOM construction, style calculation, layout, and the final paint.

The Runtime Theory Team1 min read10 steps

layer stack

Client

HWHardware
KKernel
RTRuntime
APPApplication
SYSSystem
CLIClient
NETNetwork
TLSCrypto
SRVServer

trace spine

  1. 01 Browser receives HTML bytes over the network
  2. 02 HTML parser tokenizes bytes into DOM nodes
  3. 03 CSS parser tokenizes bytes into CSSOM nodes
  4. 04 DOM and CSSOM are merged into the Render Tree
  5. 05 Layout engine calculates geometry for every element
  6. 06 Rasterizer converts elements into pixels
  7. 07 Compositor composites pixel layers onto the screen
  8. 08 JavaScript blocks rendering until it finishes executing
  9. 09 DOMContentLoaded fires — page is structurally complete
  10. 10 load event fires — all resources downloaded
▸ On this page

Trace: Browser Renders a Page

The Critical Rendering Path

mermaid
graph LR
  A[Network] --> B[DOM Construction]
  C[Network] --> D[CSSOM Construction]
  B --> E[Render Tree]
  D --> E
  E --> F[Layout]
  F --> G[Paint]
  G --> H[Composite]

Key Takeaways

  • CSS is render-blocking: the browser waits for CSSOM before building the Render Tree.
  • JavaScript is parser-blocking: executing JS can modify the DOM, so the parser pauses.
  • Layout is expensive: reading element geometry triggers a recalculation of the entire Render Tree.
  • Paint is expensive: rasterizing pixels is costly, especially for large viewports.
plaintext
 

Not started

Sign in to save your learning progress.

Sign in to save