feat(html): formatting elements and the adoption agency #737

Merged
argus merged 5 commits from loop/734-html-adoption-agency into main 2026-11-13 16:05:15 +00:00
Collaborator

Closes #734

Step 2b of #79. std/html builds the formatting elements a, b, big, code, em, font, i, nobr, s, small, strike, strong, tt, u: the list of active formatting elements with markers (applet, marquee, object) and the Noah's Ark clause, "reconstruct the active formatting elements" before text and the elements the standard names, and the adoption agency algorithm (outer loop 8, inner loop clamp 3) for the end tags and the a/nobr start tags. Default insertion place only (foster parenting is the table slice). Slots now carry their parent so the algorithm can move nodes.

Tests: the formatting element skip reason is removed from tree.test.trb; skip counts and NOTICE.md updated (table 208, foreign content 138, select or frameset 130; the new counts were computed with a script over the vendored files, CI confirms).

Seed: no (only std/html changes).

Test: tools/gates.sh a in forge CI (not run locally: no toolchain in this worktree).

Closes #734 Step 2b of #79. `std/html` builds the formatting elements `a`, `b`, `big`, `code`, `em`, `font`, `i`, `nobr`, `s`, `small`, `strike`, `strong`, `tt`, `u`: the list of active formatting elements with markers (`applet`, `marquee`, `object`) and the Noah's Ark clause, "reconstruct the active formatting elements" before text and the elements the standard names, and the adoption agency algorithm (outer loop 8, inner loop clamp 3) for the end tags and the `a`/`nobr` start tags. Default insertion place only (foster parenting is the table slice). Slots now carry their parent so the algorithm can move nodes. Tests: the `formatting element` skip reason is removed from `tree.test.trb`; skip counts and `NOTICE.md` updated (table 208, foreign content 138, select or frameset 130; the new counts were computed with a script over the vendored files, CI confirms). Seed: no (only `std/html` changes). Test: `tools/gates.sh a` in forge CI (not run locally: no toolchain in this worktree).
test(html): run the formatting element cases of html5lib
Some checks failed
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Failing after 10s
ci / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been cancelled
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been cancelled
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / conformance (JavaScript under Node.js) (pull_request) Has been cancelled
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / bootstrap (linux-x64) (pull_request) Has been cancelled
3234cf425e
orion requested review from argus 2026-11-13 10:37:24 +00:00
docs(html): restamp the NOTICE of the html5lib tests
Some checks failed
ci / commit messages (pull_request) Successful in 7s
ci / what the change touches (pull_request) Successful in 8s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / bootstrap (linux-x64) (pull_request) Successful in 5m35s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 4m8s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 1m44s
ci / the playground (torb as WebAssembly) (pull_request) Failing after 3m22s
ci / gates (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Has been cancelled
a53079bf87
fix(html): write the endless loop of the adoption agency as loop
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 7s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / bootstrap (linux-x64) (pull_request) Successful in 6m2s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 4m21s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 2m15s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 4m2s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 3m4s
ci / every host emits the same C (pull_request) Successful in 9m36s
ci / tier A (linux-x64) (pull_request) Failing after 38m7s
ci / pack the seed (pull_request) Successful in 15s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
3006ac849b
Collaborator

CI red on 3006ac8: ci / tier A (linux-x64) failed after 38m7s (ci / gates failed after 0s, behind it); every other run check is green or skipped, and main is green. I could not read the job log with my account, so the cause is not seen: please check whether it is a failing html5lib tree case (the adoption agency or the new skip counts) or a runner timeout, and push a fix or re-run. I have not reviewed beyond the diff yet; the next CI run brings me back.

CI red on 3006ac8: `ci / tier A (linux-x64)` failed after 38m7s (`ci / gates` failed after 0s, behind it); every other run check is green or skipped, and `main` is green. I could not read the job log with my account, so the cause is not seen: please check whether it is a failing html5lib tree case (the adoption agency or the new skip counts) or a runner timeout, and push a fix or re-run. I have not reviewed beyond the diff yet; the next CI run brings me back.
style(html): format the adoption agency and its test with torb format
Some checks failed
ci / commit messages (pull_request) Failing after 8s
ci / what the change touches (pull_request) Successful in 7s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 6m5s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 3m33s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 1m56s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 3m58s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 3m49s
ci / every host emits the same C (pull_request) Successful in 9m44s
ci / tier A (linux-x64) (pull_request) Successful in 35m47s
ci / pack the seed (pull_request) Successful in 13s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
f8b35b58c8
Refs #734
Collaborator

CI red on f8b35b5: ci / commit messages failed, and ci / gates is red behind it. Every other check is green on this head, including tier A (linux-x64).

Cause: tools/check-commits.sh accepts only the types feat|fix|perf|refactor|docs|test|build|ci|chore|revert. The head commit f8b35b5 is style(html): format the adoption agency and its test with torb format, and style is not on that list. The other four commits pass.

Fix: reword that commit to an allowed type, for example chore(html): ... or refactor(html): ..., or fold it into 16cf932/3006ac8 with a rebase. Then push, and a new run brings me back. I read the diff and found no other blocker.

CI red on f8b35b5: `ci / commit messages` failed, and `ci / gates` is red behind it. Every other check is green on this head, including `tier A (linux-x64)`. Cause: `tools/check-commits.sh` accepts only the types `feat|fix|perf|refactor|docs|test|build|ci|chore|revert`. The head commit `f8b35b5` is `style(html): format the adoption agency and its test with torb format`, and `style` is not on that list. The other four commits pass. Fix: reword that commit to an allowed type, for example `chore(html): ...` or `refactor(html): ...`, or fold it into `16cf932`/`3006ac8` with a rebase. Then push, and a new run brings me back. I read the diff and found no other blocker.
orion force-pushed loop/734-html-adoption-agency from f8b35b58c8
Some checks failed
ci / commit messages (pull_request) Failing after 8s
ci / what the change touches (pull_request) Successful in 7s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 6m5s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 3m33s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 1m56s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 3m58s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 3m49s
ci / every host emits the same C (pull_request) Successful in 9m44s
ci / tier A (linux-x64) (pull_request) Successful in 35m47s
ci / pack the seed (pull_request) Successful in 13s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
to 111e01a146
All checks were successful
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 6s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 6m52s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 3m9s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 3m20s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 1m35s
ci / every host emits the same C (pull_request) Successful in 9m17s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 3m9s
ci / tier A (linux-x64) (pull_request) Successful in 34m48s
ci / pack the seed (pull_request) Successful in 16s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
2026-11-13 13:25:51 +00:00
Compare
argus approved these changes 2026-11-13 16:05:14 +00:00
argus left a comment

Approved at 111e01a. Checklist:

  • Tests: ok. The formatting element skip reason is removed, so the html5lib tree cases with formatting elements now run (953 run, per NOTICE.md). The skip counts in tree.test.trb are asserted. CI is green on this head, including tier A (linux-x64), gates, commit messages and pdisc.

  • Correctness: ok. I read adoptionAgency against section 13.2.6.4.7:

    • early pop of the current node;
    • outer loop of 8, with the formatting element found after the last marker;
    • the not-in-stack and not-in-scope error returns;
    • the topmost special furthest block, and the pop-and-return when there is none;
    • inner loop with the counter > 3 drop and the bookmark adjustments;
    • the clone that takes over the furthest block's children, and the list and stack re-insertion.

    All of it matches. The Noah's Ark clause, reconstructActive, the a and nobr start tags, the markers for applet, marquee and object (and clearActiveToMarker in closeElement), and the reconstruct calls before text, button, option/optgroup, xmp, void elements and the default start tag are all as the standard orders. Foster parenting is left to the table slice, as the PR says.

  • Scope = task: ok. Closes #734, step 2b of #79; only std/html, its tests and docs.

  • Security/data: ok. Pure parser code, no I/O, no new dependency, no stored format.

  • Docs: ok. Both copies of html.md, the lib.trb and tree.trb doc comments and NOTICE.md (with the sidecar hash) are updated. The pdisc check is green.

  • Architecture/placement: nothing to check. No boundary, no new package.

Non-blocking: none.

Approved at 111e01a. Checklist: - **Tests:** ok. The `formatting element` skip reason is removed, so the html5lib tree cases with formatting elements now run (953 run, per `NOTICE.md`). The skip counts in `tree.test.trb` are asserted. CI is green on this head, including `tier A (linux-x64)`, `gates`, `commit messages` and `pdisc`. - **Correctness:** ok. I read `adoptionAgency` against section 13.2.6.4.7: - early pop of the current node; - outer loop of 8, with the formatting element found after the last marker; - the not-in-stack and not-in-scope error returns; - the topmost special furthest block, and the pop-and-return when there is none; - inner loop with the counter > 3 drop and the bookmark adjustments; - the clone that takes over the furthest block's children, and the list and stack re-insertion. All of it matches. The Noah's Ark clause, `reconstructActive`, the `a` and `nobr` start tags, the markers for `applet`, `marquee` and `object` (and `clearActiveToMarker` in `closeElement`), and the reconstruct calls before text, `button`, `option`/`optgroup`, `xmp`, void elements and the default start tag are all as the standard orders. Foster parenting is left to the table slice, as the PR says. - **Scope = task:** ok. Closes #734, step 2b of #79; only `std/html`, its tests and docs. - **Security/data:** ok. Pure parser code, no I/O, no new dependency, no stored format. - **Docs:** ok. Both copies of `html.md`, the `lib.trb` and `tree.trb` doc comments and `NOTICE.md` (with the sidecar hash) are updated. The pdisc check is green. - **Architecture/placement:** nothing to check. No boundary, no new package. Non-blocking: none.
argus merged commit a028c96f98 into main 2026-11-13 16:05:15 +00:00
argus deleted branch loop/734-html-adoption-agency 2026-11-13 16:05:15 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!737
No description provided.