feat(html): tree construction, first slice (HtmlNode, HtmlDocument.parse) #716
No reviewers
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language!716
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/688-html-tree-construction"
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?
Closes #688
Step 2a of #79: the first slice of the tree construction of
std/html.What changes
HtmlNode(document, doctype, element, text, comment; ordered children),HtmlQuirksModeandHtmlDocument.parse(text)answeringtree,quirksanderrors(tokenizer and tree errors). It never fails; there is noResult.initial,before html,before head,in head,after head,in body(no formatting elements, no tables),text,after body,after after body, plus thenoscriptbranch ofin headfor scripting off. Impliedhtml,headandbody; the quirks mode comes from the doctype with the standard's full list of identifiers.<script>,<style>,<textarea>,<title>,<plaintext>,<xmp>,<iframe>,<noembed>,<noframes>; a line feed after<pre>,<listing>,<textarea>is dropped.HtmlTokenizer.location()is new so the tree construction can place its own errors.tree.trb.tree-constructionvendored asstd/html/tests/html5lib-tree/(commit9329e646, the last one that still has the directory; the tokenizer tests stay at their commit).tools/html/vendor.trbwrites both;NOTICE.mdsays where they come from.std/html/tests/tree.test.trbruns every covered case: 842 pass. The rest is a named skip list, counted by the test so it can not drift: fragment 192, scripting on 8, formatting element 127, table 194, foreign content 137, template 79, select or frameset 129 (the first matching reason).lib.trbexports,docs/standard-library/index.mdand the generated skills.Not covered / deviations
#errorsof the cases are not compared (prose, not codes of the standard).domjs-unsafe,plain-text-unsafeandpending-spec-changes-plain-text-unsafeare not vendored (CR and NUL do not survive a raw string and the formatter). Intests2.data line of one space is empty, no case depends on it.Checked locally
torb test std/html(tree, document and the earlier suites),torb docs check docs,docs declarations --check,docs skill docs skills --check,torb format --check,tools/check-commits.sh. Gates run in CI.HtmlNode,HtmlDocument.parse(step 2a of #79) #688HtmlNode,HtmlDocument.parse(step 2a of #79) #688CI red on
818493f:ci / tier A (linux-x64)failed after 37m57s (the 120 min timeout is not the cause; main passes it in about 32m), soci / gatesis red. The job log is not readable with my token, so I cannot name the failing test; please check the log of run 2582, job 5 and push a fix. My review stays pending and runs again once CI is green on the new head.Review of
cb3fd71(CI green on this head, includingci / gates,tier A,tier B,pdisc).tree.test.trbruns 842 html5lib tree-construction cases againstHtmlDocument.parseand pins the skip counts per reason (fragment 192, scripting on 8, formatting 127, table 194, foreign 137, template 79, select/frameset 129), so the skip list cannot drift.document.test.trbcovers the API.tree.trbfollows the standard for the nine modes plusin head noscript; parse never fails, noResult, as the design record asks.HtmlTokenizer.location()is a pure extraction of the old line/column lookup, so tokenizer errors are unchanged.tree.trb.NOTICE.mdupdated.docs/standard-library/html.md,index.md, the generated skill files,NOTICE.mdand the pdisc sidecar are updated and pdisc is green.std/html, exported fromlib.trb; no new boundary or external dependency.Non-blocking: the deviations the PR lists (errors not compared, three unsafe
.datfiles not vendored, over-wide skip classifier) are documented and acceptable for a first slice.Approved; merging by rebase.
HtmlNode,HtmlDocument.parse(step 2a of #79) #688std/htmldocuments (epic) #79