Core Phases

Phase Description
HTML Parsing The browser parses HTML from top to bottom, constructing the DOM tree.
CSS Parsing External and inline styles are parsed into the CSSOM (CSS Object Model).
JavaScript Execution JavaScript can pause HTML parsing and manipulate the DOM.
Render Tree Construction The DOM and CSSOM are combined into the render tree.
Layout (Reflow) The browser calculates the position and size of each element.
Paint Pixels are drawn to the screen.

Render Performance Timeline

  1. Parse HTML
  2. Block on <script> or <link> (if synchronous)
  3. Execute inline or deferred scripts
  4. Build DOM and CSSOM
  5. Construct Render Tree
  6. Layout and Paint

Resource Blocking Behavior

Resource Type Blocks Parsing Blocks Paint Notes
<script> (no defer/async) Yes Yes Pauses HTML parsing until the script is downloaded and executed.
<link rel="stylesheet"> No Yes Parsing continues, but painting is delayed until styles are ready.
<script defer> No No Executes after HTML is fully parsed, in order.
<script async> No No Executes as soon as downloaded, out of order.

Script Loading Behaviors

Script Type Blocks HTML Parsing Execution Timing Use Case
Inline <script> Yes Immediately Minimal logic that must run early
<script> (default) Yes Immediately (synchronous) Theme setup, critical blocking logic
<script defer> No After HTML is parsed (ordered) Main application logic
<script async> No When downloaded (unordered) Analytics, ads, third-party scripts