From 2f36581a94b1dd13fe4ff07e41fd11a86a6f78dc Mon Sep 17 00:00:00 2001 From: x_ror <16686943+x-ror@users.noreply.github.com> Date: Wed, 18 Nov 2026 21:49:18 +0200 Subject: [PATCH] docs(larva): record the HTML parser decision (#10) lexbor, unmodified, with the pause and document.write done on our side of the input (pkg/html, #68). The comparison against our own tree builder waits for the oracle corpus (#2). Co-Authored-By: Claude Opus 5.5 --- docs/LARVA.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/LARVA.md b/docs/LARVA.md index 816297e..27f67bd 100644 --- a/docs/LARVA.md +++ b/docs/LARVA.md @@ -181,6 +181,17 @@ core has fake geometry. Sensor-script and captcha sites stay on Chrome either wa against the partial tree), accepts `document.write` input into the tokenizer stream, then resumes. Fragment parsing (`innerHTML`) builds into the live tree. A batch `parse(string) → Document` API is not the design. + - **Parser decision (#10, settled 2026-11-18).** lexbor, unmodified, as the + tokenizer and tree builder (`pkg/html`, #68). lexbor has neither the pause + nor `document.write` — its tree builder leaves both as `TODO` at + `` — and needs neither, because the caller holds the input: + slices handed to lexbor never run past a script end tag, a C shim on its + token callback reports which script that tag closed, and written text is + parsed at the insertion point before the rest of the input. So no fork of + lexbor and no own tokenizer. The comparison of "lexbor as the DOM" against + "lexbor tokenizer + our own tree builder" on real pages waits for the + oracle corpus (#2); until then lexbor's tree is the DOM, and the wrapper + rule above applies to its nodes. 5. **Wire protocols stay in adapters.** The HTTP crawling server contract, domain routing lists and compatibility shims live in an adapter package (`pkg/adapters`), keeping the browser engine independent of any single