tree construction

The parsing stage that takes tokens from the tokenizer and assembles them into the DOM tree, tracking which elements are still open.

In more detail

The tree builder keeps a stack of open elements: a start tag pushes a new element as a child of the current one and an end tag pops it. When markup is broken, rules in this stage decide where misplaced elements actually go.

Related terms

Taught in

References