formats: std/html documents (epic) #79
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?
Context
std/htmlas a document format: the WHATWG parsing algorithm reads any HTML, old or broken, into a tree, and the tree can be written back. This is an epic: the standard's tokenizer alone has 80 states and a 2231-name table, tree construction adds 23 insertion modes, the adoption agency algorithm, foster parenting, foreign content and templates. That is more than one PR. Steps become issues just in time, one at a time. The builder side of the package (Html<Message>,Markup<Message>, escaping) is #93, not this epic.Source
std/xml).HtmlEncode/HtmlDecodeand no mapping DSL. This corrects the old acceptance line "the package onEncodeandDecode", which came from the planning list and contradicts the design record.Html.sanitized(markup, policy)"parses and keeps an allowlist") and section 4.3 (the checker tokenizes static parts withstd/html's tokenizer): the two consumers of this epic.std/xmlandstd/tomlare the layout models (format value or entry type, tree, parser, writer, vendored suite, docs page).Design record point
ROADMAP "Which versions a format supports" (HTML row); ENCODING.md section 9; WEB.md decision D13 (three packages,
std/htmlhas no HTTP in it and is useful alone). Decided by the loop:std/html, shared with #93. The document side usesHtmlToken,HtmlTokenizer,HtmlParseError,HtmlNode,HtmlDocument,HtmlFragment; no type namedHtmlis introduced here, becauseHtml<Message>is #93's (WEB.md section 4). Name clash avoided on purpose: the entry point isHtmlDocument.parse(text), notHtml().parse(text)asXml().parse(text)would suggest.HtmlDocument.parseanswers the tree with the list of parse errors beside it, not aResult.String; detecting the encoding of bytes is not in this epic.scriptingflag stays off, so<noscript>content is parsed as markup), CSS or DOM queries beyond walking the tree,Html.sanitizeditself (#93, after step 4 here).std/htmland no std name is looked up by string. A later step of another epic that makes the checker import the tokenizer (#108) carries the two-commit rule itself.Steps
std/html,HtmlToken,HtmlTokenizer,HtmlParseError, the 2231-name table, html5lib-tests' tokenizer suite, docs page #439HtmlNode,HtmlDocument.parse(text), all insertion modes for HTML elements including the adoption agency algorithm, foster parenting, quirks mode and implied elements; the html5lib-tests tree-construction cases that need no foreign content, template or fragment<template>, fragment parsingHtmlFragment.parse(context, text); the rest of the tree-construction suite passesHtmlNode.toHtml(), text and attribute escaping, void elements;parse(toHtml(parse(text)))equalsparse(text)over the suite; small tree helpers (children, attribute lookup, text content); docs page completeDependencies
std/encodingis not used (no data binding).std/htmlmarkup, WEB slice 1): independent code,lib.trband the docs page are the only shared files; whichever lands second adds its lines. Neither blocks the other.Html.sanitized(markup, policy)of #93 (needs steps 2 to 4), the checker's tokenizer use in #108 (needs step 1).std/xml, its own grammar and tree) and #80.Moved from the planning lists of the docs; the design record stays the specification.
[loop:torbscript] intake: in scope (author orion, label loop), sources ROADMAP.md format versions and ENCODING.md section 9, not a duplicate, no collision with a design record. Shares the package with WEB.md slice 1; refine checks that overlap. next: refine, waiting (ready buffer full: #4, #163, #164, #223 are ready) until 2026-10-10T04:00:00Z
std/xmltree, reader and writer (step 1 of #78) #429std/xml#78[loop:torbscript] claim refine by session:loop-torbscript-20261023 until 2026-10-23T18:08Z
std/html(step 1 of #79) #439formats:to formats:std/htmldocumentsstd/htmldocuments (epic)[loop:torbscript] decided by the loop: #79 is too big for one PR, so it is an epic and stays without
ready. The WHATWG tokenizer (80 states, 2231 named references), tree construction (23 insertion modes, adoption agency, foster parenting), foreign content with templates and fragments, and the serializer are four reviewable pieces, in the order each needs the previous. Step 1 is filed as #439 (keyword search of open issues for html, tokenizer, entity, whatwg, sanitiz found only #93 and #108 as neighbours, none a duplicate) and isready; steps 2 to 4 are filed just in time.Decisions:
std/html, but #93 is the builder (Html<Message>,Markup<Message>, escaping) and this is the reader (tokens,HtmlNode,HtmlDocument). No code is shared, so neither blocks the other; to avoid a name clash this epic introduces no type calledHtmland the entry point isHtmlDocument.parse, notHtml().parse. The second to land adds its lines tolib.trband the docs page.Html.sanitizedof #93 needs steps 2 to 4 here.EncodeandDecode" is dropped: ENCODING.md section 9 says a page is not data binding and gets a tree type with ordinary functions (asstd/xmlhas noXmlEncode).Result.std/html. #108 (checker uses the tokenizer) carries the two-commit rule itself.std/xml.[loop:torbscript] refine: released the claim of session:loop-torbscript-20261023. #79 is an epic (checklist of 4 steps in the body), step 1 filed as #439 with label
ready. Nothing was written to the repo. Worker usage: about 90k tokens (sonnet).next: waiting (epic waits on its steps)
std/html(step 1 of #79) #439std/htmlmarkup (WEB slice 1) #93std/htmlmarkup (WEB slice 1) #93std/webcore (WEB slice 2) #94std/webcore (WEB slice 2) #94[loop:torbscript] claim refine by session:loop-torbscript-20261030 @anthropic:theorben until 2026-10-30T12:02Z
HtmlNode,HtmlDocument.parse(step 2a of #79) #688[loop:torbscript] refine: step 1 (#439, PR #443) is on
main(std/html tokenizer and html5lib tokenizer suite present), so it is ticked in the checklist. Decided by the loop: step 2 (23 insertion modes, adoption agency, foster parenting, quirks, a new vendored suite) is more than one PR, so only its first slice is filed: #688 (HtmlNode,HtmlDocument.parse, document skeleton and plain content modes, vendored tree-construction suite with a named skip list). Keyword search of open and closed issues for html, tree construction found no duplicate (#650 is the book page, #93 and #108 are neighbours). The rest of step 2 (formatting elements and adoption agency, tables and foster parenting) is filed just in time after #688 lands. No seed touch.released the claim of session:loop-torbscript-20261030
next: waiting (epic waits on its steps)