HTML Rendering Engine

The browser has various layers which speak to each other. Here we are mainly concerned with the rendering engine layer.

Browser Structure

Displaying content in the browser window is a multi-step process.

Overview

To retrieve an HTML document, the browser fetches the asset. It is received in bytes, similar to machine code. These bytes are transformed into tokens which are parsed to create the DOM.

Error Tolerance

Before html we had xhtml strict. With xhtml strict, if a dev made a mistake, the end user would see a big nasty error in the browser window.

Parsing Flow

Tokens are converted into nodes which are attached to the parse tree.

Parser

The parse tree is later converted into the DOM tree.

Parse Tree

Continued in CSS Rendering Engine.