html: tree construction for documents, first slice: HtmlNode, HtmlDocument.parse (step 2a of #79) #688
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #79 (step 2, first slice). Step 1 (#439) is on
main:HtmlTokenizer,HtmlToken,HtmlParseError.Goal
std/htmlreads a document into a tree. This slice is the tree type and the construction for the document skeleton and plain content; the adoption agency algorithm, tables and foster parenting follow as the next slice(s) of step 2 (just in time, once this lands). Tree construction in full is more than one PR, so only this first slice is filed.Acceptance criteria
HtmlNode(document, doctype, element with name and attributes, text, comment; children in order) andHtmlDocument.parse(text)answering the tree, the quirks mode and theHtmlParseErrorlist (tokenizer and tree errors). Reading never fails, noResult(design record of #79).initial,before html,before head,in head,after head,in body(without formatting elements and tables),text,after body,after after body; impliedhtml,head,body; quirks mode from the doctype; the tokenizer switches for<script>,<style>,<textarea>,<title>,<plaintext>and similar raw-text elements.scriptingstays off (<noscript>is markup).tree-constructionsuite, vendored liketests/html5lib(same commit,NOTICE.mdupdated), runs instd/html/tests; every case this slice covers passes, the rest sit in a named skip list with the reason (formatting, table, foreign content, template, fragment) that the next slices shrink.lib.trbexports for the new names;tools/gates.sh agreen in CI.Design pointers
std/xml(node.trb,parser.trb) and the existingstd/htmltokenizer (tokenizer.trb,state.trb).HtmlNode,HtmlDocument, no type calledHtml(that is #93's).String; no encoding detection.Seed
No. Only
std/htmlchanges; the compiler imports nostd/htmlname. If a compiler change turns out to be needed, split it into its own commit and stop: a seed touch means a teaching commit and a migration commit, and the seed refresh is the owner's step.Size
One PR, one or two Conventional Commits (
feat(html): ...for the tree,test(html): ...for the vendored suite).std/htmldocuments (epic) #79[loop:torbscript] claim implementation by session:loop-torbscript-20261030 @anthropic:tkoehn until 2026-10-31T01:31Z
[loop:torbscript] release implementation by session:loop-torbscript-20261030 @anthropic:tkoehn: the worker run ended without a result (the worker runtime refused its oversized output log); no branch, commit or PR was pushed, so nothing is left to pick up. The item is still
ready; the next worker starts from main and keeps its command output small.next: implementation