HTML, Browsers & The Code
We often think of HTML as visual, but to the computer, it is just data structure. The Browser is the bridge between raw code and visual experience.
Parsing
When the browser loads a file, it parses the HTML byte by byte. It tokenizes the tags and constructs the DOM (Document Object Model).
The Render Tree
The browser combines the DOM with CSS rules to create a "Render Tree". This tree only contains elements that are visible on the screen. Elements with display: none do not appear here.
Layout & Paint
Finally, the browser calculates the exact geometry of each element (Layout) and fills in the pixels (Paint). This happens milliseconds before you see the result.
View Full Transcript+
Detailed breakdown of the Critical Rendering Path: 1. DOM Construction, 2. CSSOM Construction, 3. Render Tree, 4. Layout, 5. Paint. Includes notes on reflow and repaint costs.
