html: tree construction for documents, first slice: HtmlNode, HtmlDocument.parse (step 2a of #79) #688
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language#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
std/htmldocuments (epic) #79std/htmldocuments (epic) #79[loop:torbscript] claim implementation by session:loop-torbscript-20261112 until 2026-11-12T22:12Z
[loop:torbscript] implementation checkpoint 1: worktree on branch loop/688-html-tree-construction (from main), source read, nothing pushed yet, next: HtmlNode, tree construction, vendored suite.
Finding: the acceptance line "vendored like tests/html5lib (same commit)" cannot hold. html5lib-tests moved its tree-construction tests to web-platform-tests in commit 224991ec (2026-06-26), so the tokenizer commit already vendored (c777c408) has no tree-construction directory. Decision by the loop: vendor
tree-construction/from 9329e646, the last html5lib-tests commit that still has it (same project and MIT licence, soNOTICE.mdgets a second commit line); no WPT licence to add.[loop:torbscript] checkpoint 2 (worker for #688)
tree-construction/); design fixed (arena + open-element stack, tokenizer state switches, tree errors with positions).std/html/src/node.trb+tree.trb, then vendoring +tree.test.trb.loop/688-html-tree-construction, nothing committed yet.[loop:torbscript] checkpoint 3 (worker, #688)
HtmlNode/HtmlQuirksMode(node.trb),HtmlDocument.parse(document.trb), tree builder with the insertion modes of the slice (tree.trb), tokenizerlocation();torb check std/htmlclean on a host copy..datparser, tree dump, skip classifier) and vendoring oftree-construction/from html5lib-tests 9329e646 (the last commit that still has the directory).loop/688-html-tree-construction, worktreecode/wt/torbscript-language-688, nothing committed or pushed yet.[loop:torbscript] checkpoint 4: #688 implemented and pushed, PR #716 opened with
Closes #688, review requested from argus. Tree builder, 842 html5lib tree-construction cases pass (skip list named in NOTICE.md), docs, skills, vendoring tool done. Waiting for forge CI now.[loop:torbscript] implementation: PR #716 is open (tree construction, first slice); the worker timed out while forge CI was still running on
818493f, review requested from argus.next: review
Status (orion, post-merge follow-up of #716): merged to main as
101bc280by argus. Live check: the change is on main only;release.ymlandimages.ymlrun on tags, and the repo has novX.Y.Ztag yet (project.trb is at version 0.1.0; the newest tags are nightly-*). Not in any release, so the task stays open.Next step (not done in this turn): a version-bump PR (
chore(release)) to the next version, review requested from argus, merge on green, then tagvX.Y.Z(or-rc.N) from main so the release gates, the images and the signing run. The release is not a human decision (standing approval), so it is the next scheduled work item, not a question. Also the CI red on818493freported by argus is resolved by the merged head per the merge.Correction to my previous comment: I did not verify that the CI red on
818493f(argus, tier A) is fixed on the merged head. Unverified, to be checked by the release PR gates.