On this page
Critical Rendering Path
Prev: rendering | Up: rendering | Next: Reflow, Repaint & Performance
Rel: Document & Landmarks, Cascade, Specificity & Inheritance, Reflow, Repaint & Performance
Ref: MDN Web Docs — Critical Rendering Path
Tags: #public #web #platform #rendering
Contents
HTML + CSS to Pixels Pipeline
Every frame the browser renders follows six stages:
HTML bytes -> Parse -> DOM Tree ──┐
├──> Render Tree -> Layout (Reflow) -> Paint -> Composite
CSS bytes -> Parse -> CSSOM Tree ─┘
- DOM: HTML bytes are tokenized into the Document Object Model tree.
- CSSOM: CSS rules are parsed into the CSS Object Model; the cascade resolves computed styles.
- Render Tree: Combines visible DOM nodes with their CSSOM computed styles (omitting
display: noneand<head>). - Layout (Reflow): Calculates exact box geometry (position & dimensions) in viewport coordinates.
- Paint: Rasterizes text, colors, borders, and shadows into layer bitmaps.
- Composite: GPU composites layers in stacking order onto the screen.
Render-Blocking Resources
- CSS is render-blocking: The browser waits for CSSOM before painting to avoid unstyled flashes. Keep critical CSS lean.
- Synchronous
<script>is parser-blocking: Usedeferortype="module"so HTML parsing proceeds uninterrupted.
Linked from
Related notes
- tuts/web/rendering Linked here; links to this page; shared tags: #platform, #rendering, #web
- tuts/web/rendering/reflow_repaint_and_performance Linked here; links to this page; shared tags: #platform, #rendering, #web
- tuts/css/tutorials/cascade_specificity_and_inheritance Linked here; links to this page; shared tags: #web
- tuts/html/elements/document_and_landmarks Linked here; links to this page; shared tags: #web
- tuts/css links to this page; shared tags: #web
- tuts/css/tutorials links to this page; shared tags: #web
- tuts/html links to this page; shared tags: #web
- tuts/web shared tags: #platform, #web
- tuts/web/apis shared tags: #platform, #web
- tuts/web/apis/fetch_and_networking shared tags: #platform, #web