we (web engine): Experimental web browser project to understand the limits of Claude

Implement HTML tree builder: build DOM from tokens master

Simplified HTML5 tree construction algorithm that processes tokenizer output and builds a DOM tree. Handles insertion modes (Initial through AfterAfterBody), implicit html/head/body creation, void elements, p-in-p auto-closing, heading scope, and the "any other end tag" algorithm. Supports: html, head, body, title, p, h1-h6, div, span, a, br, pre, text nodes, comment nodes, and attributes. 17 unit tests covering full documents, implicit elements, void elements, misnesting, inline nesting, headings, comments, pre, attributes, text merging, and step-by-step token processing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>


+1163 -1
2 changed files