From 34273bd6067ba79a4ecbe64d47948d289279aed7 Mon Sep 17 00:00:00 2001 From: Joris Jansen Date: Sat, 8 Aug 2026 16:20:32 +0200 Subject: [PATCH] AE13d: curate native parser conformance corpus --- .../fixtures/html5/conformance/README.md | 21 +++- .../active-formatting-recovery/fixture.toml | 3 + .../parse-errors.txt | 2 + .../active-formatting-recovery/patches.txt | 24 +++++ .../active-formatting-recovery/tree.txt | 13 +++ .../body-text-recovery/fixture.toml | 23 +++++ .../conformance/body-text-recovery/input.html | 1 + .../conformance/body-text-recovery/tree.txt | 10 ++ .../comment-and-shell/fixture.toml | 24 +++++ .../conformance/comment-and-shell/input.html | 1 + .../conformance/comment-and-shell/tokens.txt | 4 + .../conformance/comment-and-shell/tree.txt | 6 ++ .../document-mode-limited/document-mode.txt | 2 + .../document-mode-limited/fixture.toml | 23 +++++ .../document-mode-limited/input.html | 1 + .../document-mode-no-quirks/document-mode.txt | 2 + .../document-mode-no-quirks/fixture.toml | 23 +++++ .../document-mode-no-quirks/input.html | 1 + .../document-mode-quirks/document-mode.txt | 2 + .../document-mode-quirks/fixture.toml | 23 +++++ .../document-mode-quirks/input.html | 1 + .../fixture.toml | 2 + .../document-recovery-diagnostics/tokens.txt | 6 ++ .../document-recovery-diagnostics/tree.txt | 9 ++ .../foreign-breakout-integration/fixture.toml | 23 +++++ .../foreign-breakout-integration/input.html | 1 + .../foreign-breakout-integration/tree.txt | 11 +++ .../foreign-content-integration/fixture.toml | 1 + .../foreign-content-integration/tree.txt | 17 ++++ .../foreign-qualified-attributes/fixture.toml | 36 +++++++ .../foreign-qualified-attributes/input.html | 1 + .../foreign-qualified-attributes/tree.txt | 16 +++ .../form-controls-textarea/fixture.toml | 36 +++++++ .../form-controls-textarea/input.html | 2 + .../form-controls-textarea/tree.txt | 13 +++ .../form-pointer-state/fixture.toml | 1 + .../conformance/form-pointer-state/tree.txt | 11 +++ .../form-self-closing/fixture.toml | 38 +++++++ .../implementation-diagnostics.txt | 1 + .../conformance/form-self-closing/input.html | 1 + .../form-self-closing/parse-errors.txt | 4 + .../conformance/form-self-closing/tree.txt | 8 ++ .../foster-parented-element/fixture.toml | 37 +++++++ .../foster-parented-element/input.html | 1 + .../foster-parented-element/patches.txt | 20 ++++ .../foster-parented-element/tree.txt | 11 +++ .../fixture.toml | 37 +++++++ .../preprocessing-cr-normalization/input.bin | 2 + .../preprocessing-cr-normalization/tokens.txt | 3 + .../fixture.toml | 4 + .../parse-errors.txt | 1 + .../patches.txt | 16 +++ .../tokens.txt | 6 ++ .../tree.txt | 9 ++ .../fixture.toml | 39 ++++++++ .../input.html | 1 + .../parse-errors.txt | 4 + .../patches.txt | 16 +++ .../tokens.txt | 8 ++ .../processing-instruction-malformed/tree.txt | 9 ++ .../fixture.toml | 30 ++++++ .../representative-static-document/input.html | 1 + .../representative-static-document/tree.txt | 13 +++ .../conformance/select-recovery/fixture.toml | 29 ++++++ .../conformance/select-recovery/input.html | 1 + .../conformance/select-recovery/tree.txt | 12 +++ .../select-table-interaction/fixture.toml | 37 +++++++ .../select-table-interaction/input.html | 1 + .../select-table-interaction/patches.txt | 20 ++++ .../select-table-interaction/tree.txt | 11 +++ .../fixture.toml | 2 + .../patches.txt | 26 +++++ .../table-buffering-foster-parenting/tree.txt | 14 +++ .../template-state-eof/fixture.toml | 2 + .../template-state-eof/patches.txt | 28 ++++++ .../conformance/template-state-eof/tree.txt | 16 +++ .../tokenizer-eof-recovery/fixture.toml | 2 + .../tokenizer-eof-recovery/parse-errors.txt | 2 + .../tokenizer-eof-recovery/tokens.txt | 4 + .../fixture.toml | 23 +++++ .../input.html | 1 + .../unsupported-features.txt | 3 + .../fixture.toml | 23 +++++ .../input.html | 1 + .../unsupported-features.txt | 2 + .../fixture.toml | 23 +++++ .../input.html | 1 + .../unsupported-features.txt | 2 + .../fixture.toml | 23 +++++ .../input.html | 1 + .../unsupported-features.txt | 2 + .../fixture.toml | 23 +++++ .../input.html | 1 + .../unsupported-features.txt | 2 + .../utf8-decoding-preprocessing/fixture.toml | 1 + .../utf8-decoding-preprocessing/tokens.txt | 3 + docs/engine-feature-gap-tracker.md | 10 ++ ...3-parser-conformance-regression-harness.md | 8 ++ docs/html5/ae13d-native-corpus-coverage.md | 99 +++++++++++++++++++ 99 files changed, 1174 insertions(+), 1 deletion(-) create mode 100644 crates/html/tests/fixtures/html5/conformance/active-formatting-recovery/parse-errors.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/active-formatting-recovery/patches.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/active-formatting-recovery/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/body-text-recovery/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/body-text-recovery/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/body-text-recovery/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/comment-and-shell/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/comment-and-shell/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/comment-and-shell/tokens.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/comment-and-shell/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/document-mode-limited/document-mode.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/document-mode-limited/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/document-mode-limited/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/document-mode-no-quirks/document-mode.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/document-mode-no-quirks/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/document-mode-no-quirks/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/document-mode-quirks/document-mode.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/document-mode-quirks/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/document-mode-quirks/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/document-recovery-diagnostics/tokens.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/document-recovery-diagnostics/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/foreign-breakout-integration/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/foreign-breakout-integration/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/foreign-breakout-integration/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/foreign-content-integration/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/foreign-qualified-attributes/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/foreign-qualified-attributes/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/foreign-qualified-attributes/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/form-controls-textarea/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/form-controls-textarea/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/form-controls-textarea/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/form-pointer-state/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/form-self-closing/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/form-self-closing/implementation-diagnostics.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/form-self-closing/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/form-self-closing/parse-errors.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/form-self-closing/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/foster-parented-element/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/foster-parented-element/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/foster-parented-element/patches.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/foster-parented-element/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/preprocessing-cr-normalization/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/preprocessing-cr-normalization/input.bin create mode 100644 crates/html/tests/fixtures/html5/conformance/preprocessing-cr-normalization/tokens.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/parse-errors.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/patches.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/tokens.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/parse-errors.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/patches.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/tokens.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/representative-static-document/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/representative-static-document/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/representative-static-document/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/select-recovery/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/select-recovery/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/select-recovery/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/select-table-interaction/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/select-table-interaction/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/select-table-interaction/patches.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/select-table-interaction/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/table-buffering-foster-parenting/patches.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/table-buffering-foster-parenting/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/template-state-eof/patches.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/template-state-eof/tree.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/tokenizer-eof-recovery/parse-errors.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/tokenizer-eof-recovery/tokens.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/unsupported-body-attribute-merge/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/unsupported-body-attribute-merge/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/unsupported-body-attribute-merge/unsupported-features.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/unsupported-caption-preparation/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/unsupported-caption-preparation/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/unsupported-caption-preparation/unsupported-features.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/unsupported-html-attribute-merge/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/unsupported-html-attribute-merge/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/unsupported-html-attribute-merge/unsupported-features.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/unsupported-table-cell-end-guard/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/unsupported-table-cell-end-guard/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/unsupported-table-cell-end-guard/unsupported-features.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/unsupported-table-cell-preparation/fixture.toml create mode 100644 crates/html/tests/fixtures/html5/conformance/unsupported-table-cell-preparation/input.html create mode 100644 crates/html/tests/fixtures/html5/conformance/unsupported-table-cell-preparation/unsupported-features.txt create mode 100644 crates/html/tests/fixtures/html5/conformance/utf8-decoding-preprocessing/tokens.txt create mode 100644 docs/html5/ae13d-native-corpus-coverage.md diff --git a/crates/html/tests/fixtures/html5/conformance/README.md b/crates/html/tests/fixtures/html5/conformance/README.md index 7400dd69..a5c1a114 100644 --- a/crates/html/tests/fixtures/html5/conformance/README.md +++ b/crates/html/tests/fixtures/html5/conformance/README.md @@ -47,7 +47,26 @@ collections. Fixture-v1 remains an isolated compatibility format. See `docs/html5/parser-fixture-format-v2.md` and `docs/html5/ae13b5-parser-snapshot-formats.md` for the schema/codecs, and `docs/html5/ae13-parser-conformance-regression-harness.md` for ownership and -slice boundaries. +slice boundaries. The AE13d coverage matrix and native expected-output +provenance record is `docs/html5/ae13d-native-corpus-coverage.md`. + +Native fixture expectations are independently justified. Generated output may +be used as candidate serialization, but it is never sufficient provenance for +parser-significant behavior. Before adding a token, error, mode, tree, patch, +transition, unsupported-feature, or invariant expectation, review the +applicable completed AE contract and trusted unit, golden, html5lib/WPT, or +other independently reviewed evidence. Do not add every available surface by +default: transitions prove parser-state behavior, and patches prove mutation +ordering that a final tree cannot establish. Native provenance is documented +in the matrix because the v2 schema intentionally does not permit a native +`source.provenance` field. + +Unsupported-feature expectations are exact identities for documented current +limitations only. They are active parser runs, not skips, xfails, wildcards, +or permissive snapshots, and they must never hide behavior owned by a +completed AE issue. The parser implementation and canonical whole-input +baseline are not an oracle for semantic correctness; the baseline is used for +delivery parity only. Run this corpus with: diff --git a/crates/html/tests/fixtures/html5/conformance/active-formatting-recovery/fixture.toml b/crates/html/tests/fixtures/html5/conformance/active-formatting-recovery/fixture.toml index c8948119..eb872583 100644 --- a/crates/html/tests/fixtures/html5/conformance/active-formatting-recovery/fixture.toml +++ b/crates/html/tests/fixtures/html5/conformance/active-formatting-recovery/fixture.toml @@ -21,6 +21,9 @@ unit = "unicode-scalars" strategy = "boundaries" boundaries = [1] [expectations] +parse_errors = "parse-errors.txt" +tree = "tree.txt" +patches = "patches.txt" final_invariants = "final-invariants.txt" [disposition] status = "active" diff --git a/crates/html/tests/fixtures/html5/conformance/active-formatting-recovery/parse-errors.txt b/crates/html/tests/fixtures/html5/conformance/active-formatting-recovery/parse-errors.txt new file mode 100644 index 00000000..38da8d61 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/active-formatting-recovery/parse-errors.txt @@ -0,0 +1,2 @@ +# format: html5-parse-errors-v1 +PARSE_ERROR occurrence=1 stage=tree-construction code=tree-construction:adoption-formatting-element-not-current-node recovery=pop-open-elements position=unavailable:parser-did-not-provide-position context=present context-token=end-tag context-mode=in-body context-namespace=html diff --git a/crates/html/tests/fixtures/html5/conformance/active-formatting-recovery/patches.txt b/crates/html/tests/fixtures/html5/conformance/active-formatting-recovery/patches.txt new file mode 100644 index 00000000..d89130a7 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/active-formatting-recovery/patches.txt @@ -0,0 +1,24 @@ +# format: html5-dompatch-v3 +PATCH operation=1 kind=create-document node="node-1" legacy-doctype=null +PATCH operation=2 kind=create-document-type node="node-2" name="html" public-id=null system-id=null +PATCH operation=3 kind=append-child parent="node-1" child="node-2" +PATCH operation=4 kind=create-element node="node-3" namespace=html local-name="html" +PATCH operation=5 kind=append-child parent="node-1" child="node-3" +PATCH operation=6 kind=create-element node="node-4" namespace=html local-name="head" +PATCH operation=7 kind=append-child parent="node-3" child="node-4" +PATCH operation=8 kind=create-element node="node-5" namespace=html local-name="body" +PATCH operation=9 kind=append-child parent="node-3" child="node-5" +PATCH operation=10 kind=create-element node="node-6" namespace=html local-name="p" +PATCH operation=11 kind=append-child parent="node-5" child="node-6" +PATCH operation=12 kind=create-element node="node-7" namespace=html local-name="b" +PATCH operation=13 kind=append-child parent="node-6" child="node-7" +PATCH operation=14 kind=create-element node="node-8" namespace=html local-name="i" +PATCH operation=15 kind=append-child parent="node-7" child="node-8" +PATCH operation=16 kind=create-text node="node-9" text="x" +PATCH operation=17 kind=append-child parent="node-8" child="node-9" +PATCH operation=18 kind=create-element node="node-10" namespace=html local-name="i" +PATCH operation=19 kind=append-child parent="node-6" child="node-10" +PATCH operation=20 kind=create-text node="node-11" text="y" +PATCH operation=21 kind=append-child parent="node-10" child="node-11" +PATCH operation=22 kind=create-text node="node-12" text="\n" +PATCH operation=23 kind=append-child parent="node-6" child="node-12" diff --git a/crates/html/tests/fixtures/html5/conformance/active-formatting-recovery/tree.txt b/crates/html/tests/fixtures/html5/conformance/active-formatting-recovery/tree.txt new file mode 100644 index 00000000..5de1481c --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/active-formatting-recovery/tree.txt @@ -0,0 +1,13 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=document-type name="html" public-id=null system-id=null +NODE path=/root[0]/child[1] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[1]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[1]/child[1] kind=element namespace=html local-name="body" +NODE path=/root[0]/child[1]/child[1]/child[0] kind=element namespace=html local-name="p" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[0] kind=element namespace=html local-name="b" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[0]/child[0] kind=element namespace=html local-name="i" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[0]/child[0]/child[0] kind=text data="x" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[1] kind=element namespace=html local-name="i" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[1]/child[0] kind=text data="y" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[2] kind=text data="\n" diff --git a/crates/html/tests/fixtures/html5/conformance/body-text-recovery/fixture.toml b/crates/html/tests/fixtures/html5/conformance/body-text-recovery/fixture.toml new file mode 100644 index 00000000..3ae8fb43 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/body-text-recovery/fixture.toml @@ -0,0 +1,23 @@ +format = "borrowser-html-parser-fixture-v2" +id = "body-text-recovery" +[source] +kind = "native" +[input] +path = "input.html" +kind = "utf8-text" +sha256 = "14da7553a95c1109c379de48c176287761130743bb481c5c30272df24775213b" +[execution] +reference_delivery = "whole" +[execution.target] +kind = "document" +scripting = "disabled" +[[execution.deliveries]] +name = "whole" +unit = "unicode-scalars" +strategy = "whole" +[expectations] +tree = "tree.txt" +[disposition] +status = "active" +[metadata] +description = "Text encountered before any explicit body is recovered into the implicitly constructed body before the paragraph." diff --git a/crates/html/tests/fixtures/html5/conformance/body-text-recovery/input.html b/crates/html/tests/fixtures/html5/conformance/body-text-recovery/input.html new file mode 100644 index 00000000..80660c46 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/body-text-recovery/input.html @@ -0,0 +1 @@ +lead

ok

diff --git a/crates/html/tests/fixtures/html5/conformance/body-text-recovery/tree.txt b/crates/html/tests/fixtures/html5/conformance/body-text-recovery/tree.txt new file mode 100644 index 00000000..cf199619 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/body-text-recovery/tree.txt @@ -0,0 +1,10 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=document-type name="html" public-id=null system-id=null +NODE path=/root[0]/child[1] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[1]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[1]/child[1] kind=element namespace=html local-name="body" +NODE path=/root[0]/child[1]/child[1]/child[0] kind=text data="lead" +NODE path=/root[0]/child[1]/child[1]/child[1] kind=element namespace=html local-name="p" +NODE path=/root[0]/child[1]/child[1]/child[1]/child[0] kind=text data="ok" +NODE path=/root[0]/child[1]/child[1]/child[2] kind=text data="\n" diff --git a/crates/html/tests/fixtures/html5/conformance/comment-and-shell/fixture.toml b/crates/html/tests/fixtures/html5/conformance/comment-and-shell/fixture.toml new file mode 100644 index 00000000..e823bd90 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/comment-and-shell/fixture.toml @@ -0,0 +1,24 @@ +format = "borrowser-html-parser-fixture-v2" +id = "comment-and-shell" +[source] +kind = "native" +[input] +path = "input.html" +kind = "utf8-text" +sha256 = "d00e4d92e67ade8ad96f814a5b6ee083d97f2eefc9baa6360704d56177e3bc9f" +[execution] +reference_delivery = "whole" +[execution.target] +kind = "document" +scripting = "disabled" +[[execution.deliveries]] +name = "whole" +unit = "unicode-scalars" +strategy = "whole" +[expectations] +tokens = "tokens.txt" +tree = "tree.txt" +[disposition] +status = "active" +[metadata] +description = "A minimal comment proves token recovery and parser-created document shell placement." diff --git a/crates/html/tests/fixtures/html5/conformance/comment-and-shell/input.html b/crates/html/tests/fixtures/html5/conformance/comment-and-shell/input.html new file mode 100644 index 00000000..5669179a --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/comment-and-shell/input.html @@ -0,0 +1 @@ + diff --git a/crates/html/tests/fixtures/html5/conformance/comment-and-shell/tokens.txt b/crates/html/tests/fixtures/html5/conformance/comment-and-shell/tokens.txt new file mode 100644 index 00000000..aff06c9e --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/comment-and-shell/tokens.txt @@ -0,0 +1,4 @@ +# format: html5-token-v2 +TOKEN ordinal=1 kind=comment data="x" +TOKEN ordinal=2 kind=character data="\n" +TOKEN ordinal=3 kind=eof diff --git a/crates/html/tests/fixtures/html5/conformance/comment-and-shell/tree.txt b/crates/html/tests/fixtures/html5/conformance/comment-and-shell/tree.txt new file mode 100644 index 00000000..ace2d771 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/comment-and-shell/tree.txt @@ -0,0 +1,6 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=comment data="x" +NODE path=/root[0]/child[1] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[1]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[1]/child[1] kind=element namespace=html local-name="body" diff --git a/crates/html/tests/fixtures/html5/conformance/document-mode-limited/document-mode.txt b/crates/html/tests/fixtures/html5/conformance/document-mode-limited/document-mode.txt new file mode 100644 index 00000000..6cf99458 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/document-mode-limited/document-mode.txt @@ -0,0 +1,2 @@ +# format: html5-document-mode-v1 +MODE value=limited-quirks diff --git a/crates/html/tests/fixtures/html5/conformance/document-mode-limited/fixture.toml b/crates/html/tests/fixtures/html5/conformance/document-mode-limited/fixture.toml new file mode 100644 index 00000000..43947ec5 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/document-mode-limited/fixture.toml @@ -0,0 +1,23 @@ +format = "borrowser-html-parser-fixture-v2" +id = "document-mode-limited" +[source] +kind = "native" +[input] +path = "input.html" +kind = "utf8-text" +sha256 = "b7d8c652a82df0e343c53e45fd26f45be2243017aa288cd242fd975b0bbae15e" +[execution] +reference_delivery = "whole" +[execution.target] +kind = "document" +scripting = "disabled" +[[execution.deliveries]] +name = "whole" +unit = "unicode-scalars" +strategy = "whole" +[expectations] +document_mode = "document-mode.txt" +[disposition] +status = "active" +[metadata] +description = "HTML4 transitional public identifier selects limited-quirks mode." diff --git a/crates/html/tests/fixtures/html5/conformance/document-mode-limited/input.html b/crates/html/tests/fixtures/html5/conformance/document-mode-limited/input.html new file mode 100644 index 00000000..10fb0ad1 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/document-mode-limited/input.html @@ -0,0 +1 @@ + diff --git a/crates/html/tests/fixtures/html5/conformance/document-mode-no-quirks/document-mode.txt b/crates/html/tests/fixtures/html5/conformance/document-mode-no-quirks/document-mode.txt new file mode 100644 index 00000000..87d01a65 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/document-mode-no-quirks/document-mode.txt @@ -0,0 +1,2 @@ +# format: html5-document-mode-v1 +MODE value=no-quirks diff --git a/crates/html/tests/fixtures/html5/conformance/document-mode-no-quirks/fixture.toml b/crates/html/tests/fixtures/html5/conformance/document-mode-no-quirks/fixture.toml new file mode 100644 index 00000000..d2395514 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/document-mode-no-quirks/fixture.toml @@ -0,0 +1,23 @@ +format = "borrowser-html-parser-fixture-v2" +id = "document-mode-no-quirks" +[source] +kind = "native" +[input] +path = "input.html" +kind = "utf8-text" +sha256 = "335fca8574f060eea24ebcdae6b78f32414f5de03da1084fd0e73d710768e3a9" +[execution] +reference_delivery = "whole" +[execution.target] +kind = "document" +scripting = "disabled" +[[execution.deliveries]] +name = "whole" +unit = "unicode-scalars" +strategy = "whole" +[expectations] +document_mode = "document-mode.txt" +[disposition] +status = "active" +[metadata] +description = "HTML doctype selects no-quirks mode." diff --git a/crates/html/tests/fixtures/html5/conformance/document-mode-no-quirks/input.html b/crates/html/tests/fixtures/html5/conformance/document-mode-no-quirks/input.html new file mode 100644 index 00000000..c50eddd4 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/document-mode-no-quirks/input.html @@ -0,0 +1 @@ + diff --git a/crates/html/tests/fixtures/html5/conformance/document-mode-quirks/document-mode.txt b/crates/html/tests/fixtures/html5/conformance/document-mode-quirks/document-mode.txt new file mode 100644 index 00000000..4d1d923f --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/document-mode-quirks/document-mode.txt @@ -0,0 +1,2 @@ +# format: html5-document-mode-v1 +MODE value=quirks diff --git a/crates/html/tests/fixtures/html5/conformance/document-mode-quirks/fixture.toml b/crates/html/tests/fixtures/html5/conformance/document-mode-quirks/fixture.toml new file mode 100644 index 00000000..e04a6ec2 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/document-mode-quirks/fixture.toml @@ -0,0 +1,23 @@ +format = "borrowser-html-parser-fixture-v2" +id = "document-mode-quirks" +[source] +kind = "native" +[input] +path = "input.html" +kind = "utf8-text" +sha256 = "5c891195176e751b4531afce5cc323e22a6ba0f15a0ef77032a694fb5b7eb03c" +[execution] +reference_delivery = "whole" +[execution.target] +kind = "document" +scripting = "disabled" +[[execution.deliveries]] +name = "whole" +unit = "unicode-scalars" +strategy = "whole" +[expectations] +document_mode = "document-mode.txt" +[disposition] +status = "active" +[metadata] +description = "Legacy doctype selects quirks mode; mode is the only requested semantic surface." diff --git a/crates/html/tests/fixtures/html5/conformance/document-mode-quirks/input.html b/crates/html/tests/fixtures/html5/conformance/document-mode-quirks/input.html new file mode 100644 index 00000000..89b14e4f --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/document-mode-quirks/input.html @@ -0,0 +1 @@ + diff --git a/crates/html/tests/fixtures/html5/conformance/document-recovery-diagnostics/fixture.toml b/crates/html/tests/fixtures/html5/conformance/document-recovery-diagnostics/fixture.toml index 56abd453..deb8f133 100644 --- a/crates/html/tests/fixtures/html5/conformance/document-recovery-diagnostics/fixture.toml +++ b/crates/html/tests/fixtures/html5/conformance/document-recovery-diagnostics/fixture.toml @@ -22,6 +22,8 @@ unit = "unicode-scalars" strategy = "whole" [expectations] +tokens = "tokens.txt" +tree = "tree.txt" parse_errors = "parse-errors.txt" implementation_diagnostics = "implementation-diagnostics.txt" diff --git a/crates/html/tests/fixtures/html5/conformance/document-recovery-diagnostics/tokens.txt b/crates/html/tests/fixtures/html5/conformance/document-recovery-diagnostics/tokens.txt new file mode 100644 index 00000000..1ef625a3 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/document-recovery-diagnostics/tokens.txt @@ -0,0 +1,6 @@ +# format: html5-token-v2 +TOKEN ordinal=1 kind=doctype name="html" public-id=null system-id=null force-quirks=false +TOKEN ordinal=2 kind=start-tag name="div" self-closing=true +TOKEN_ATTRIBUTE token=2 index=0 name="a" value="first" +TOKEN ordinal=3 kind=character data="\n" +TOKEN ordinal=4 kind=eof diff --git a/crates/html/tests/fixtures/html5/conformance/document-recovery-diagnostics/tree.txt b/crates/html/tests/fixtures/html5/conformance/document-recovery-diagnostics/tree.txt new file mode 100644 index 00000000..1de75b48 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/document-recovery-diagnostics/tree.txt @@ -0,0 +1,9 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=document-type name="html" public-id=null system-id=null +NODE path=/root[0]/child[1] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[1]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[1]/child[1] kind=element namespace=html local-name="body" +NODE path=/root[0]/child[1]/child[1]/child[0] kind=element namespace=html local-name="div" +ATTRIBUTE path=/root[0]/child[1]/child[1]/child[0] index=0 namespace=none prefix=null local-name="a" value="first" +NODE path=/root[0]/child[1]/child[1]/child[1] kind=text data="\n" diff --git a/crates/html/tests/fixtures/html5/conformance/foreign-breakout-integration/fixture.toml b/crates/html/tests/fixtures/html5/conformance/foreign-breakout-integration/fixture.toml new file mode 100644 index 00000000..47cb995f --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/foreign-breakout-integration/fixture.toml @@ -0,0 +1,23 @@ +format = "borrowser-html-parser-fixture-v2" +id = "foreign-breakout-integration" +[source] +kind = "native" +[input] +path = "input.html" +kind = "utf8-text" +sha256 = "05ff086fe66306396c5796b03285d224b3ebf03e07316e8b5299154949d4c5d1" +[execution] +reference_delivery = "whole" +[execution.target] +kind = "document" +scripting = "disabled" +[[execution.deliveries]] +name = "whole" +unit = "unicode-scalars" +strategy = "whole" +[expectations] +tree = "tree.txt" +[disposition] +status = "active" +[metadata] +description = "A breakout HTML paragraph exits foreign content before the trailing HTML div." diff --git a/crates/html/tests/fixtures/html5/conformance/foreign-breakout-integration/input.html b/crates/html/tests/fixtures/html5/conformance/foreign-breakout-integration/input.html new file mode 100644 index 00000000..b7b75a6f --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/foreign-breakout-integration/input.html @@ -0,0 +1 @@ +

x

after diff --git a/crates/html/tests/fixtures/html5/conformance/foreign-breakout-integration/tree.txt b/crates/html/tests/fixtures/html5/conformance/foreign-breakout-integration/tree.txt new file mode 100644 index 00000000..a5e9a98b --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/foreign-breakout-integration/tree.txt @@ -0,0 +1,11 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[0]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[0]/child[1] kind=element namespace=html local-name="body" +NODE path=/root[0]/child[0]/child[1]/child[0] kind=element namespace=svg local-name="svg" +NODE path=/root[0]/child[0]/child[1]/child[0]/child[0] kind=element namespace=svg local-name="g" +NODE path=/root[0]/child[0]/child[1]/child[1] kind=element namespace=html local-name="p" +NODE path=/root[0]/child[0]/child[1]/child[1]/child[0] kind=text data="x" +NODE path=/root[0]/child[0]/child[1]/child[2] kind=element namespace=html local-name="div" +NODE path=/root[0]/child[0]/child[1]/child[2]/child[0] kind=text data="after\n" diff --git a/crates/html/tests/fixtures/html5/conformance/foreign-content-integration/fixture.toml b/crates/html/tests/fixtures/html5/conformance/foreign-content-integration/fixture.toml index 9a519358..3d803d95 100644 --- a/crates/html/tests/fixtures/html5/conformance/foreign-content-integration/fixture.toml +++ b/crates/html/tests/fixtures/html5/conformance/foreign-content-integration/fixture.toml @@ -21,6 +21,7 @@ unit = "unicode-scalars" strategy = "boundaries" boundaries = [1] [expectations] +tree = "tree.txt" final_invariants = "final-invariants.txt" [disposition] status = "active" diff --git a/crates/html/tests/fixtures/html5/conformance/foreign-content-integration/tree.txt b/crates/html/tests/fixtures/html5/conformance/foreign-content-integration/tree.txt new file mode 100644 index 00000000..f93f9633 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/foreign-content-integration/tree.txt @@ -0,0 +1,17 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=document-type name="html" public-id=null system-id=null +NODE path=/root[0]/child[1] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[1]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[1]/child[1] kind=element namespace=html local-name="body" +NODE path=/root[0]/child[1]/child[1]/child[0] kind=element namespace=svg local-name="svg" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[0] kind=element namespace=svg local-name="foreignObject" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[0]/child[0] kind=element namespace=html local-name="p" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[0]/child[0]/child[0] kind=text data="x" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[1] kind=element namespace=svg local-name="circle" +NODE path=/root[0]/child[1]/child[1]/child[1] kind=element namespace=mathml local-name="math" +NODE path=/root[0]/child[1]/child[1]/child[1]/child[0] kind=element namespace=mathml local-name="annotation-xml" +ATTRIBUTE path=/root[0]/child[1]/child[1]/child[1]/child[0] index=0 namespace=none prefix=null local-name="encoding" value="text/html" +NODE path=/root[0]/child[1]/child[1]/child[1]/child[0]/child[0] kind=element namespace=html local-name="p" +NODE path=/root[0]/child[1]/child[1]/child[1]/child[0]/child[0]/child[0] kind=text data="y" +NODE path=/root[0]/child[1]/child[1]/child[2] kind=text data="\n" diff --git a/crates/html/tests/fixtures/html5/conformance/foreign-qualified-attributes/fixture.toml b/crates/html/tests/fixtures/html5/conformance/foreign-qualified-attributes/fixture.toml new file mode 100644 index 00000000..5d1c66b8 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/foreign-qualified-attributes/fixture.toml @@ -0,0 +1,36 @@ +format = "borrowser-html-parser-fixture-v2" +id = "foreign-qualified-attributes" + +[source] +kind = "native" + +[input] +path = "input.html" +kind = "utf8-text" +sha256 = "73c7bb555564d426e5bb6c7f360ccca7ca1f6aab66fe465a55d5795030c4abaf" + +[execution] +reference_delivery = "whole-unicode" + +[execution.target] +kind = "document" +scripting = "disabled" + +[[execution.deliveries]] +name = "whole-unicode" +unit = "unicode-scalars" +strategy = "whole" + +[[execution.deliveries]] +name = "declared-scalar-split" +unit = "unicode-scalars" +strategy = "boundaries" +boundaries = [1] + +[expectations] +tree = "tree.txt" +[disposition] +status = "active" + +[metadata] +description = "SVG adjusted local names and qualified XML/XLink/XMLNS attributes retain expanded namespace identity." diff --git a/crates/html/tests/fixtures/html5/conformance/foreign-qualified-attributes/input.html b/crates/html/tests/fixtures/html5/conformance/foreign-qualified-attributes/input.html new file mode 100644 index 00000000..b0fd532b --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/foreign-qualified-attributes/input.html @@ -0,0 +1 @@ + diff --git a/crates/html/tests/fixtures/html5/conformance/foreign-qualified-attributes/tree.txt b/crates/html/tests/fixtures/html5/conformance/foreign-qualified-attributes/tree.txt new file mode 100644 index 00000000..d2fa58c6 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/foreign-qualified-attributes/tree.txt @@ -0,0 +1,16 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[0]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[0]/child[1] kind=element namespace=html local-name="body" +NODE path=/root[0]/child[0]/child[1]/child[0] kind=element namespace=svg local-name="svg" +ATTRIBUTE path=/root[0]/child[0]/child[1]/child[0] index=0 namespace=none prefix=null local-name="viewBox" value="0 0 1 1" +ATTRIBUTE path=/root[0]/child[0]/child[1]/child[0] index=1 namespace=xlink prefix="xlink" local-name="href" value="outer" +ATTRIBUTE path=/root[0]/child[0]/child[1]/child[0] index=2 namespace=xml prefix="xml" local-name="lang" value="en" +ATTRIBUTE path=/root[0]/child[0]/child[1]/child[0] index=3 namespace=xmlns prefix=null local-name="xmlns" value="http://www.w3.org/2000/svg" +ATTRIBUTE path=/root[0]/child[0]/child[1]/child[0] index=4 namespace=xmlns prefix="xmlns" local-name="xlink" value="http://www.w3.org/1999/xlink" +NODE path=/root[0]/child[0]/child[1]/child[0]/child[0] kind=element namespace=svg local-name="path" +ATTRIBUTE path=/root[0]/child[0]/child[1]/child[0]/child[0] index=0 namespace=none prefix=null local-name="attributeName" value="d" +ATTRIBUTE path=/root[0]/child[0]/child[1]/child[0]/child[0] index=1 namespace=none prefix=null local-name="href" value="plain" +ATTRIBUTE path=/root[0]/child[0]/child[1]/child[0]/child[0] index=2 namespace=xlink prefix="xlink" local-name="href" value="qualified" +NODE path=/root[0]/child[0]/child[1]/child[1] kind=text data="\n" diff --git a/crates/html/tests/fixtures/html5/conformance/form-controls-textarea/fixture.toml b/crates/html/tests/fixtures/html5/conformance/form-controls-textarea/fixture.toml new file mode 100644 index 00000000..025b87ef --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/form-controls-textarea/fixture.toml @@ -0,0 +1,36 @@ +format = "borrowser-html-parser-fixture-v2" +id = "form-controls-textarea" + +[source] +kind = "native" + +[input] +path = "input.html" +kind = "utf8-text" +sha256 = "dadf6831a153110aa8dcaddc07e0ac7de3ff5e7d175e500c5b4288ec50420590" + +[execution] +reference_delivery = "whole-unicode" + +[execution.target] +kind = "document" +scripting = "disabled" + +[[execution.deliveries]] +name = "whole-unicode" +unit = "unicode-scalars" +strategy = "whole" + +[[execution.deliveries]] +name = "declared-scalar-split" +unit = "unicode-scalars" +strategy = "boundaries" +boundaries = [1] + +[expectations] +tree = "tree.txt" +[disposition] +status = "active" + +[metadata] +description = "Form-associated input and textarea construction, including textarea text-mode content." diff --git a/crates/html/tests/fixtures/html5/conformance/form-controls-textarea/input.html b/crates/html/tests/fixtures/html5/conformance/form-controls-textarea/input.html new file mode 100644 index 00000000..a527d86b --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/form-controls-textarea/input.html @@ -0,0 +1,2 @@ +
diff --git a/crates/html/tests/fixtures/html5/conformance/form-controls-textarea/tree.txt b/crates/html/tests/fixtures/html5/conformance/form-controls-textarea/tree.txt new file mode 100644 index 00000000..1c4cdb28 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/form-controls-textarea/tree.txt @@ -0,0 +1,13 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=document-type name="html" public-id=null system-id=null +NODE path=/root[0]/child[1] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[1]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[1]/child[1] kind=element namespace=html local-name="body" +NODE path=/root[0]/child[1]/child[1]/child[0] kind=element namespace=html local-name="form" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[0] kind=element namespace=html local-name="input" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[1] kind=element namespace=html local-name="textarea" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[1]/child[0] kind=text data="text" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[2] kind=element namespace=html local-name="button" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[2]/child[0] kind=text data="go" +NODE path=/root[0]/child[1]/child[1]/child[1] kind=text data="\n" diff --git a/crates/html/tests/fixtures/html5/conformance/form-pointer-state/fixture.toml b/crates/html/tests/fixtures/html5/conformance/form-pointer-state/fixture.toml index 2311c0c2..904a4ef4 100644 --- a/crates/html/tests/fixtures/html5/conformance/form-pointer-state/fixture.toml +++ b/crates/html/tests/fixtures/html5/conformance/form-pointer-state/fixture.toml @@ -21,6 +21,7 @@ unit = "unicode-scalars" strategy = "boundaries" boundaries = [1] [expectations] +tree = "tree.txt" final_invariants = "final-invariants.txt" [disposition] status = "active" diff --git a/crates/html/tests/fixtures/html5/conformance/form-pointer-state/tree.txt b/crates/html/tests/fixtures/html5/conformance/form-pointer-state/tree.txt new file mode 100644 index 00000000..a78c8eb5 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/form-pointer-state/tree.txt @@ -0,0 +1,11 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=document-type name="html" public-id=null system-id=null +NODE path=/root[0]/child[1] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[1]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[1]/child[1] kind=element namespace=html local-name="body" +NODE path=/root[0]/child[1]/child[1]/child[0] kind=element namespace=html local-name="form" +ATTRIBUTE path=/root[0]/child[1]/child[1]/child[0] index=0 namespace=none prefix=null local-name="id" value="a" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[0] kind=element namespace=html local-name="div" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[0]/child[0] kind=element namespace=html local-name="input" +NODE path=/root[0]/child[1]/child[1]/child[1] kind=text data="\n" diff --git a/crates/html/tests/fixtures/html5/conformance/form-self-closing/fixture.toml b/crates/html/tests/fixtures/html5/conformance/form-self-closing/fixture.toml new file mode 100644 index 00000000..8d838b25 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/form-self-closing/fixture.toml @@ -0,0 +1,38 @@ +format = "borrowser-html-parser-fixture-v2" +id = "form-self-closing" + +[source] +kind = "native" + +[input] +path = "input.html" +kind = "utf8-text" +sha256 = "d28458f64aeb3006c21935aa749bf74b25110f96c28303b903af63a9c435fc2d" + +[execution] +reference_delivery = "whole-unicode" + +[execution.target] +kind = "document" +scripting = "disabled" + +[[execution.deliveries]] +name = "whole-unicode" +unit = "unicode-scalars" +strategy = "whole" + +[[execution.deliveries]] +name = "declared-scalar-split" +unit = "unicode-scalars" +strategy = "boundaries" +boundaries = [1] + +[expectations] +tree = "tree.txt" +parse_errors = "parse-errors.txt" +implementation_diagnostics = "implementation-diagnostics.txt" +[disposition] +status = "active" + +[metadata] +description = "A non-void form self-closing flag is recovered without treating the form as a void element." diff --git a/crates/html/tests/fixtures/html5/conformance/form-self-closing/implementation-diagnostics.txt b/crates/html/tests/fixtures/html5/conformance/form-self-closing/implementation-diagnostics.txt new file mode 100644 index 00000000..6d1b1577 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/form-self-closing/implementation-diagnostics.txt @@ -0,0 +1 @@ +# format: html5-implementation-diagnostics-v1 diff --git a/crates/html/tests/fixtures/html5/conformance/form-self-closing/input.html b/crates/html/tests/fixtures/html5/conformance/form-self-closing/input.html new file mode 100644 index 00000000..91300626 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/form-self-closing/input.html @@ -0,0 +1 @@ +
diff --git a/crates/html/tests/fixtures/html5/conformance/form-self-closing/parse-errors.txt b/crates/html/tests/fixtures/html5/conformance/form-self-closing/parse-errors.txt new file mode 100644 index 00000000..052f3b58 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/form-self-closing/parse-errors.txt @@ -0,0 +1,4 @@ +# format: html5-parse-errors-v1 +PARSE_ERROR occurrence=1 stage=tree-construction code=tree-construction:unacknowledged-self-closing-flag recovery=ignore-self-closing-flag position=unavailable:parser-did-not-provide-position context=present context-token=start-tag context-mode=in-body context-namespace=html +PARSE_ERROR occurrence=2 stage=tree-construction code=tree-construction:form-start-tag-with-active-form-pointer recovery=ignore-token position=unavailable:parser-did-not-provide-position context=present context-token=start-tag context-mode=in-body context-namespace=html +PARSE_ERROR occurrence=3 stage=tree-construction code=tree-construction:unacknowledged-self-closing-flag recovery=ignore-self-closing-flag position=unavailable:parser-did-not-provide-position context=present context-token=start-tag context-mode=in-body context-namespace=html diff --git a/crates/html/tests/fixtures/html5/conformance/form-self-closing/tree.txt b/crates/html/tests/fixtures/html5/conformance/form-self-closing/tree.txt new file mode 100644 index 00000000..b942e742 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/form-self-closing/tree.txt @@ -0,0 +1,8 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=document-type name="html" public-id=null system-id=null +NODE path=/root[0]/child[1] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[1]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[1]/child[1] kind=element namespace=html local-name="body" +NODE path=/root[0]/child[1]/child[1]/child[0] kind=element namespace=html local-name="form" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[0] kind=text data="\n" diff --git a/crates/html/tests/fixtures/html5/conformance/foster-parented-element/fixture.toml b/crates/html/tests/fixtures/html5/conformance/foster-parented-element/fixture.toml new file mode 100644 index 00000000..8e193f12 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/foster-parented-element/fixture.toml @@ -0,0 +1,37 @@ +format = "borrowser-html-parser-fixture-v2" +id = "foster-parented-element" + +[source] +kind = "native" + +[input] +path = "input.html" +kind = "utf8-text" +sha256 = "b37c7d6d915a8c0b286501946f3ec01e7e2ce620254d3d319923005ed1ce9a96" + +[execution] +reference_delivery = "whole-unicode" + +[execution.target] +kind = "document" +scripting = "disabled" + +[[execution.deliveries]] +name = "whole-unicode" +unit = "unicode-scalars" +strategy = "whole" + +[[execution.deliveries]] +name = "declared-scalar-split" +unit = "unicode-scalars" +strategy = "boundaries" +boundaries = [1] + +[expectations] +tree = "tree.txt" +patches = "patches.txt" +[disposition] +status = "active" + +[metadata] +description = "Misplaced table text and an element use ordered foster-parent InsertBefore patches." diff --git a/crates/html/tests/fixtures/html5/conformance/foster-parented-element/input.html b/crates/html/tests/fixtures/html5/conformance/foster-parented-element/input.html new file mode 100644 index 00000000..8a19a32b --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/foster-parented-element/input.html @@ -0,0 +1 @@ +y
x
diff --git a/crates/html/tests/fixtures/html5/conformance/foster-parented-element/patches.txt b/crates/html/tests/fixtures/html5/conformance/foster-parented-element/patches.txt new file mode 100644 index 00000000..38c91302 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/foster-parented-element/patches.txt @@ -0,0 +1,20 @@ +# format: html5-dompatch-v3 +PATCH operation=1 kind=create-document node="node-1" legacy-doctype=null +PATCH operation=2 kind=create-document-type node="node-2" name="html" public-id=null system-id=null +PATCH operation=3 kind=append-child parent="node-1" child="node-2" +PATCH operation=4 kind=create-element node="node-3" namespace=html local-name="html" +PATCH operation=5 kind=append-child parent="node-1" child="node-3" +PATCH operation=6 kind=create-element node="node-4" namespace=html local-name="head" +PATCH operation=7 kind=append-child parent="node-3" child="node-4" +PATCH operation=8 kind=create-element node="node-5" namespace=html local-name="body" +PATCH operation=9 kind=append-child parent="node-3" child="node-5" +PATCH operation=10 kind=create-element node="node-6" namespace=html local-name="table" +PATCH operation=11 kind=append-child parent="node-5" child="node-6" +PATCH operation=12 kind=create-text node="node-7" text="y" +PATCH operation=13 kind=insert-before parent="node-5" child="node-7" before="node-6" +PATCH operation=14 kind=create-element node="node-8" namespace=html local-name="div" +PATCH operation=15 kind=insert-before parent="node-5" child="node-8" before="node-6" +PATCH operation=16 kind=create-text node="node-9" text="x" +PATCH operation=17 kind=append-child parent="node-8" child="node-9" +PATCH operation=18 kind=create-text node="node-10" text="\n" +PATCH operation=19 kind=append-child parent="node-5" child="node-10" diff --git a/crates/html/tests/fixtures/html5/conformance/foster-parented-element/tree.txt b/crates/html/tests/fixtures/html5/conformance/foster-parented-element/tree.txt new file mode 100644 index 00000000..28120bd5 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/foster-parented-element/tree.txt @@ -0,0 +1,11 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=document-type name="html" public-id=null system-id=null +NODE path=/root[0]/child[1] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[1]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[1]/child[1] kind=element namespace=html local-name="body" +NODE path=/root[0]/child[1]/child[1]/child[0] kind=text data="y" +NODE path=/root[0]/child[1]/child[1]/child[1] kind=element namespace=html local-name="div" +NODE path=/root[0]/child[1]/child[1]/child[1]/child[0] kind=text data="x" +NODE path=/root[0]/child[1]/child[1]/child[2] kind=element namespace=html local-name="table" +NODE path=/root[0]/child[1]/child[1]/child[3] kind=text data="\n" diff --git a/crates/html/tests/fixtures/html5/conformance/preprocessing-cr-normalization/fixture.toml b/crates/html/tests/fixtures/html5/conformance/preprocessing-cr-normalization/fixture.toml new file mode 100644 index 00000000..e90b464d --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/preprocessing-cr-normalization/fixture.toml @@ -0,0 +1,37 @@ +format = "borrowser-html-parser-fixture-v2" + +id = "preprocessing-cr-normalization" + +[source] +kind = "native" + +[input] +path = "input.bin" +kind = "raw-bytes" +sha256 = "6cb634356354338e47d2d274c7a23e8b7d24c1eb18a859028adca2e322278ff2" + +[execution] +reference_delivery = "whole-bytes" + +[execution.target] +kind = "standalone-tokenizer" + +[[execution.deliveries]] +name = "whole-bytes" +unit = "bytes" +strategy = "whole" + +[[execution.deliveries]] +name = "declared-byte-splits" +unit = "bytes" +strategy = "boundaries" +boundaries = [1, 4] + +[expectations] +tokens = "tokens.txt" + +[disposition] +status = "active" + +[metadata] +description = "A lone CR in raw-byte input normalizes to LF at the completed preprocessing boundary." diff --git a/crates/html/tests/fixtures/html5/conformance/preprocessing-cr-normalization/input.bin b/crates/html/tests/fixtures/html5/conformance/preprocessing-cr-normalization/input.bin new file mode 100644 index 00000000..85e88e61 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/preprocessing-cr-normalization/input.bin @@ -0,0 +1,2 @@ +A +B C diff --git a/crates/html/tests/fixtures/html5/conformance/preprocessing-cr-normalization/tokens.txt b/crates/html/tests/fixtures/html5/conformance/preprocessing-cr-normalization/tokens.txt new file mode 100644 index 00000000..0dbab896 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/preprocessing-cr-normalization/tokens.txt @@ -0,0 +1,3 @@ +# format: html5-token-v2 +TOKEN ordinal=1 kind=character data="A\nB\nC\n" +TOKEN ordinal=2 kind=eof diff --git a/crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/fixture.toml b/crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/fixture.toml index a694b421..38a3dbef 100644 --- a/crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/fixture.toml +++ b/crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/fixture.toml @@ -21,6 +21,10 @@ unit = "unicode-scalars" strategy = "boundaries" boundaries = [1] [expectations] +tokens = "tokens.txt" +parse_errors = "parse-errors.txt" +tree = "tree.txt" +patches = "patches.txt" final_invariants = "final-invariants.txt" [disposition] status = "active" diff --git a/crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/parse-errors.txt b/crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/parse-errors.txt new file mode 100644 index 00000000..c245bdef --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/parse-errors.txt @@ -0,0 +1 @@ +# format: html5-parse-errors-v1 diff --git a/crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/patches.txt b/crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/patches.txt new file mode 100644 index 00000000..0557c48e --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/patches.txt @@ -0,0 +1,16 @@ +# format: html5-dompatch-v3 +PATCH operation=1 kind=create-document node="node-1" legacy-doctype=null +PATCH operation=2 kind=create-processing-instruction node="node-2" target="target" data="data" +PATCH operation=3 kind=append-child parent="node-1" child="node-2" +PATCH operation=4 kind=create-document-type node="node-3" name="html" public-id=null system-id=null +PATCH operation=5 kind=append-child parent="node-1" child="node-3" +PATCH operation=6 kind=create-element node="node-4" namespace=html local-name="html" +PATCH operation=7 kind=append-child parent="node-1" child="node-4" +PATCH operation=8 kind=create-element node="node-5" namespace=html local-name="head" +PATCH operation=9 kind=append-child parent="node-4" child="node-5" +PATCH operation=10 kind=create-element node="node-6" namespace=html local-name="body" +PATCH operation=11 kind=append-child parent="node-4" child="node-6" +PATCH operation=12 kind=create-element node="node-7" namespace=html local-name="p" +PATCH operation=13 kind=append-child parent="node-6" child="node-7" +PATCH operation=14 kind=create-text node="node-8" text="x\n" +PATCH operation=15 kind=append-child parent="node-7" child="node-8" diff --git a/crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/tokens.txt b/crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/tokens.txt new file mode 100644 index 00000000..d2cca8b9 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/tokens.txt @@ -0,0 +1,6 @@ +# format: html5-token-v2 +TOKEN ordinal=1 kind=processing-instruction target="target" data="data" +TOKEN ordinal=2 kind=doctype name="html" public-id=null system-id=null force-quirks=false +TOKEN ordinal=3 kind=start-tag name="p" self-closing=false +TOKEN ordinal=4 kind=character data="x\n" +TOKEN ordinal=5 kind=eof diff --git a/crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/tree.txt b/crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/tree.txt new file mode 100644 index 00000000..33c5901c --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/processing-instruction-boundaries/tree.txt @@ -0,0 +1,9 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=processing-instruction target="target" data="data" +NODE path=/root[0]/child[1] kind=document-type name="html" public-id=null system-id=null +NODE path=/root[0]/child[2] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[2]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[2]/child[1] kind=element namespace=html local-name="body" +NODE path=/root[0]/child[2]/child[1]/child[0] kind=element namespace=html local-name="p" +NODE path=/root[0]/child[2]/child[1]/child[0]/child[0] kind=text data="x\n" diff --git a/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/fixture.toml b/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/fixture.toml new file mode 100644 index 00000000..81ab15bf --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/fixture.toml @@ -0,0 +1,39 @@ +format = "borrowser-html-parser-fixture-v2" +id = "processing-instruction-malformed" + +[source] +kind = "native" + +[input] +path = "input.html" +kind = "utf8-text" +sha256 = "619cbad3f8b572e9f0bb81a8cc8edfa901ae975b44450dc3a8e52017674d3eba" + +[execution] +reference_delivery = "whole-unicode" + +[execution.target] +kind = "document" +scripting = "disabled" + +[[execution.deliveries]] +name = "whole-unicode" +unit = "unicode-scalars" +strategy = "whole" + +[[execution.deliveries]] +name = "declared-scalar-split" +unit = "unicode-scalars" +strategy = "boundaries" +boundaries = [1] + +[expectations] +tokens = "tokens.txt" +parse_errors = "parse-errors.txt" +tree = "tree.txt" +patches = "patches.txt" +[disposition] +status = "active" + +[metadata] +description = "Malformed and disallowed HTML processing-instruction targets recover as comments while valid HTML PI data remains a PI." diff --git a/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/input.html b/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/input.html new file mode 100644 index 00000000..312b4151 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/input.html @@ -0,0 +1 @@ + diff --git a/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/parse-errors.txt b/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/parse-errors.txt new file mode 100644 index 00000000..d8628e07 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/parse-errors.txt @@ -0,0 +1,4 @@ +# format: html5-parse-errors-v1 +PARSE_ERROR occurrence=1 stage=tree-construction code=tree-construction:expected-doctype-before-non-space-token recovery=reprocess-token position=unavailable:parser-did-not-provide-position context=present context-token=start-tag context-mode=initial context-namespace=null +PARSE_ERROR occurrence=2 stage=tokenizer code=standard:disallowed-processing-instruction-target recovery=null position=normalized-utf8:11:1:12:source-unavailable:no-input-provenance-map context=absent context-token=null context-mode=null context-namespace=null +PARSE_ERROR occurrence=3 stage=tokenizer code=standard:invalid-processing-instruction-target recovery=null position=normalized-utf8:17:1:18:source-unavailable:no-input-provenance-map context=absent context-token=null context-mode=null context-namespace=null diff --git a/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/patches.txt b/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/patches.txt new file mode 100644 index 00000000..ca165d92 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/patches.txt @@ -0,0 +1,16 @@ +# format: html5-dompatch-v3 +PATCH operation=1 kind=create-document node="node-1" legacy-doctype=null +PATCH operation=2 kind=create-element node="node-2" namespace=html local-name="html" +PATCH operation=3 kind=append-child parent="node-1" child="node-2" +PATCH operation=4 kind=create-element node="node-3" namespace=html local-name="head" +PATCH operation=5 kind=append-child parent="node-2" child="node-3" +PATCH operation=6 kind=create-element node="node-4" namespace=html local-name="body" +PATCH operation=7 kind=append-child parent="node-2" child="node-4" +PATCH operation=8 kind=create-comment node="node-5" data="?xml" +PATCH operation=9 kind=append-child parent="node-4" child="node-5" +PATCH operation=10 kind=create-comment node="node-6" data="?bad$" +PATCH operation=11 kind=append-child parent="node-4" child="node-6" +PATCH operation=12 kind=create-processing-instruction node="node-7" target="Pi_Target-2" data="a\\\"b\tline" +PATCH operation=13 kind=append-child parent="node-4" child="node-7" +PATCH operation=14 kind=create-text node="node-8" text="\n" +PATCH operation=15 kind=append-child parent="node-2" child="node-8" diff --git a/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/tokens.txt b/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/tokens.txt new file mode 100644 index 00000000..8abf66ac --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/tokens.txt @@ -0,0 +1,8 @@ +# format: html5-token-v2 +TOKEN ordinal=1 kind=start-tag name="body" self-closing=false +TOKEN ordinal=2 kind=comment data="?xml" +TOKEN ordinal=3 kind=comment data="?bad$" +TOKEN ordinal=4 kind=processing-instruction target="Pi_Target-2" data="a\\\"b\tline" +TOKEN ordinal=5 kind=end-tag name="body" +TOKEN ordinal=6 kind=character data="\n" +TOKEN ordinal=7 kind=eof diff --git a/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/tree.txt b/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/tree.txt new file mode 100644 index 00000000..6c73c556 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/processing-instruction-malformed/tree.txt @@ -0,0 +1,9 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[0]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[0]/child[1] kind=element namespace=html local-name="body" +NODE path=/root[0]/child[0]/child[1]/child[0] kind=comment data="?xml" +NODE path=/root[0]/child[0]/child[1]/child[1] kind=comment data="?bad$" +NODE path=/root[0]/child[0]/child[1]/child[2] kind=processing-instruction target="Pi_Target-2" data="a\\\"b\tline" +NODE path=/root[0]/child[0]/child[2] kind=text data="\n" diff --git a/crates/html/tests/fixtures/html5/conformance/representative-static-document/fixture.toml b/crates/html/tests/fixtures/html5/conformance/representative-static-document/fixture.toml new file mode 100644 index 00000000..3d4f9997 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/representative-static-document/fixture.toml @@ -0,0 +1,30 @@ +format = "borrowser-html-parser-fixture-v2" +id = "representative-static-document" + +[source] +kind = "native" + +[input] +path = "input.html" +kind = "utf8-text" +sha256 = "8043745fa537a402568c888ffd11a80675fc7f9218f667650383f94ac6beebba" + +[execution] +reference_delivery = "whole-unicode" + +[execution.target] +kind = "document" +scripting = "disabled" + +[[execution.deliveries]] +name = "whole-unicode" +unit = "unicode-scalars" +strategy = "whole" + +[expectations] +tree = "tree.txt" +[disposition] +status = "active" + +[metadata] +description = "A small ordinary static document composes title, heading, paragraph, and document shell behavior." diff --git a/crates/html/tests/fixtures/html5/conformance/representative-static-document/input.html b/crates/html/tests/fixtures/html5/conformance/representative-static-document/input.html new file mode 100644 index 00000000..cecc6613 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/representative-static-document/input.html @@ -0,0 +1 @@ +Example

Hello

Static.

diff --git a/crates/html/tests/fixtures/html5/conformance/representative-static-document/tree.txt b/crates/html/tests/fixtures/html5/conformance/representative-static-document/tree.txt new file mode 100644 index 00000000..f45c4077 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/representative-static-document/tree.txt @@ -0,0 +1,13 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=document-type name="html" public-id=null system-id=null +NODE path=/root[0]/child[1] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[1]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[1]/child[0]/child[0] kind=element namespace=html local-name="title" +NODE path=/root[0]/child[1]/child[0]/child[0]/child[0] kind=text data="Example" +NODE path=/root[0]/child[1]/child[1] kind=element namespace=html local-name="body" +NODE path=/root[0]/child[1]/child[1]/child[0] kind=element namespace=html local-name="h1" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[0] kind=text data="Hello" +NODE path=/root[0]/child[1]/child[1]/child[1] kind=element namespace=html local-name="p" +NODE path=/root[0]/child[1]/child[1]/child[1]/child[0] kind=text data="Static." +NODE path=/root[0]/child[1]/child[2] kind=text data="\n" diff --git a/crates/html/tests/fixtures/html5/conformance/select-recovery/fixture.toml b/crates/html/tests/fixtures/html5/conformance/select-recovery/fixture.toml new file mode 100644 index 00000000..9d358fe5 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/select-recovery/fixture.toml @@ -0,0 +1,29 @@ +format = "borrowser-html-parser-fixture-v2" +id = "select-recovery" +[source] +kind = "native" +[input] +path = "input.html" +kind = "utf8-text" +sha256 = "fbd092118c1064293605d9a154a92f18a8e69d8973c8c9a7f8df2200540009c4" +[execution] +reference_delivery = "whole" +[execution.target] +kind = "document" +scripting = "disabled" +[[execution.deliveries]] +name = "whole" +unit = "unicode-scalars" +strategy = "whole" + +[[execution.deliveries]] +name = "declared-scalar-split" +unit = "unicode-scalars" +strategy = "boundaries" +boundaries = [1] +[expectations] +tree = "tree.txt" +[disposition] +status = "active" +[metadata] +description = "Option start-tag recovery in select mode closes the prior option." diff --git a/crates/html/tests/fixtures/html5/conformance/select-recovery/input.html b/crates/html/tests/fixtures/html5/conformance/select-recovery/input.html new file mode 100644 index 00000000..1c338a81 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/select-recovery/input.html @@ -0,0 +1 @@ + diff --git a/crates/html/tests/fixtures/html5/conformance/select-recovery/tree.txt b/crates/html/tests/fixtures/html5/conformance/select-recovery/tree.txt new file mode 100644 index 00000000..adcf0f42 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/select-recovery/tree.txt @@ -0,0 +1,12 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=document-type name="html" public-id=null system-id=null +NODE path=/root[0]/child[1] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[1]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[1]/child[1] kind=element namespace=html local-name="body" +NODE path=/root[0]/child[1]/child[1]/child[0] kind=element namespace=html local-name="select" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[0] kind=element namespace=html local-name="option" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[0]/child[0] kind=text data="A" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[1] kind=element namespace=html local-name="option" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[1]/child[0] kind=text data="B" +NODE path=/root[0]/child[1]/child[1]/child[1] kind=text data="\n" diff --git a/crates/html/tests/fixtures/html5/conformance/select-table-interaction/fixture.toml b/crates/html/tests/fixtures/html5/conformance/select-table-interaction/fixture.toml new file mode 100644 index 00000000..ca7e6cf4 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/select-table-interaction/fixture.toml @@ -0,0 +1,37 @@ +format = "borrowser-html-parser-fixture-v2" +id = "select-table-interaction" + +[source] +kind = "native" + +[input] +path = "input.html" +kind = "utf8-text" +sha256 = "7825419035f7519f6080e776fd3eb1da1300fa0ada916464c0b0842820bcf695" + +[execution] +reference_delivery = "whole-unicode" + +[execution.target] +kind = "document" +scripting = "disabled" + +[[execution.deliveries]] +name = "whole-unicode" +unit = "unicode-scalars" +strategy = "whole" + +[[execution.deliveries]] +name = "declared-scalar-split" +unit = "unicode-scalars" +strategy = "boundaries" +boundaries = [1] + +[expectations] +tree = "tree.txt" +patches = "patches.txt" +[disposition] +status = "active" + +[metadata] +description = "A select encountered in table mode is foster-parented while its option remains under select." diff --git a/crates/html/tests/fixtures/html5/conformance/select-table-interaction/input.html b/crates/html/tests/fixtures/html5/conformance/select-table-interaction/input.html new file mode 100644 index 00000000..7ea45137 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/select-table-interaction/input.html @@ -0,0 +1 @@ +
diff --git a/crates/html/tests/fixtures/html5/conformance/select-table-interaction/patches.txt b/crates/html/tests/fixtures/html5/conformance/select-table-interaction/patches.txt new file mode 100644 index 00000000..437fcd87 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/select-table-interaction/patches.txt @@ -0,0 +1,20 @@ +# format: html5-dompatch-v3 +PATCH operation=1 kind=create-document node="node-1" legacy-doctype=null +PATCH operation=2 kind=create-document-type node="node-2" name="html" public-id=null system-id=null +PATCH operation=3 kind=append-child parent="node-1" child="node-2" +PATCH operation=4 kind=create-element node="node-3" namespace=html local-name="html" +PATCH operation=5 kind=append-child parent="node-1" child="node-3" +PATCH operation=6 kind=create-element node="node-4" namespace=html local-name="head" +PATCH operation=7 kind=append-child parent="node-3" child="node-4" +PATCH operation=8 kind=create-element node="node-5" namespace=html local-name="body" +PATCH operation=9 kind=append-child parent="node-3" child="node-5" +PATCH operation=10 kind=create-element node="node-6" namespace=html local-name="table" +PATCH operation=11 kind=append-child parent="node-5" child="node-6" +PATCH operation=12 kind=create-element node="node-7" namespace=html local-name="select" +PATCH operation=13 kind=insert-before parent="node-5" child="node-7" before="node-6" +PATCH operation=14 kind=create-element node="node-8" namespace=html local-name="option" +PATCH operation=15 kind=append-child parent="node-7" child="node-8" +PATCH operation=16 kind=create-text node="node-9" text="3" +PATCH operation=17 kind=append-child parent="node-8" child="node-9" +PATCH operation=18 kind=create-text node="node-10" text="\n" +PATCH operation=19 kind=append-child parent="node-5" child="node-10" diff --git a/crates/html/tests/fixtures/html5/conformance/select-table-interaction/tree.txt b/crates/html/tests/fixtures/html5/conformance/select-table-interaction/tree.txt new file mode 100644 index 00000000..78c7d526 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/select-table-interaction/tree.txt @@ -0,0 +1,11 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=document-type name="html" public-id=null system-id=null +NODE path=/root[0]/child[1] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[1]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[1]/child[1] kind=element namespace=html local-name="body" +NODE path=/root[0]/child[1]/child[1]/child[0] kind=element namespace=html local-name="select" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[0] kind=element namespace=html local-name="option" +NODE path=/root[0]/child[1]/child[1]/child[0]/child[0]/child[0] kind=text data="3" +NODE path=/root[0]/child[1]/child[1]/child[1] kind=element namespace=html local-name="table" +NODE path=/root[0]/child[1]/child[1]/child[2] kind=text data="\n" diff --git a/crates/html/tests/fixtures/html5/conformance/table-buffering-foster-parenting/fixture.toml b/crates/html/tests/fixtures/html5/conformance/table-buffering-foster-parenting/fixture.toml index 5f297467..f81b19b8 100644 --- a/crates/html/tests/fixtures/html5/conformance/table-buffering-foster-parenting/fixture.toml +++ b/crates/html/tests/fixtures/html5/conformance/table-buffering-foster-parenting/fixture.toml @@ -21,6 +21,8 @@ unit = "unicode-scalars" strategy = "boundaries" boundaries = [1] [expectations] +tree = "tree.txt" +patches = "patches.txt" final_invariants = "final-invariants.txt" [disposition] status = "active" diff --git a/crates/html/tests/fixtures/html5/conformance/table-buffering-foster-parenting/patches.txt b/crates/html/tests/fixtures/html5/conformance/table-buffering-foster-parenting/patches.txt new file mode 100644 index 00000000..d6d738cb --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/table-buffering-foster-parenting/patches.txt @@ -0,0 +1,26 @@ +# format: html5-dompatch-v3 +PATCH operation=1 kind=create-document node="node-1" legacy-doctype=null +PATCH operation=2 kind=create-document-type node="node-2" name="html" public-id=null system-id=null +PATCH operation=3 kind=append-child parent="node-1" child="node-2" +PATCH operation=4 kind=create-element node="node-3" namespace=html local-name="html" +PATCH operation=5 kind=append-child parent="node-1" child="node-3" +PATCH operation=6 kind=create-element node="node-4" namespace=html local-name="head" +PATCH operation=7 kind=append-child parent="node-3" child="node-4" +PATCH operation=8 kind=create-element node="node-5" namespace=html local-name="body" +PATCH operation=9 kind=append-child parent="node-3" child="node-5" +PATCH operation=10 kind=create-element node="node-6" namespace=html local-name="table" +PATCH operation=11 kind=append-child parent="node-5" child="node-6" +PATCH operation=12 kind=create-text node="node-7" text="before" +PATCH operation=13 kind=insert-before parent="node-5" child="node-7" before="node-6" +PATCH operation=14 kind=create-element node="node-8" namespace=html local-name="tbody" +PATCH operation=15 kind=append-child parent="node-6" child="node-8" +PATCH operation=16 kind=create-element node="node-9" namespace=html local-name="tr" +PATCH operation=17 kind=append-child parent="node-8" child="node-9" +PATCH operation=18 kind=create-element node="node-10" namespace=html local-name="td" +PATCH operation=19 kind=append-child parent="node-9" child="node-10" +PATCH operation=20 kind=create-text node="node-11" text="x" +PATCH operation=21 kind=append-child parent="node-10" child="node-11" +PATCH operation=22 kind=create-text node="node-12" text="after" +PATCH operation=23 kind=insert-before parent="node-5" child="node-12" before="node-6" +PATCH operation=24 kind=create-text node="node-13" text="\n" +PATCH operation=25 kind=append-child parent="node-5" child="node-13" diff --git a/crates/html/tests/fixtures/html5/conformance/table-buffering-foster-parenting/tree.txt b/crates/html/tests/fixtures/html5/conformance/table-buffering-foster-parenting/tree.txt new file mode 100644 index 00000000..fafbd8dc --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/table-buffering-foster-parenting/tree.txt @@ -0,0 +1,14 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=document-type name="html" public-id=null system-id=null +NODE path=/root[0]/child[1] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[1]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[1]/child[1] kind=element namespace=html local-name="body" +NODE path=/root[0]/child[1]/child[1]/child[0] kind=text data="before" +NODE path=/root[0]/child[1]/child[1]/child[1] kind=text data="after" +NODE path=/root[0]/child[1]/child[1]/child[2] kind=element namespace=html local-name="table" +NODE path=/root[0]/child[1]/child[1]/child[2]/child[0] kind=element namespace=html local-name="tbody" +NODE path=/root[0]/child[1]/child[1]/child[2]/child[0]/child[0] kind=element namespace=html local-name="tr" +NODE path=/root[0]/child[1]/child[1]/child[2]/child[0]/child[0]/child[0] kind=element namespace=html local-name="td" +NODE path=/root[0]/child[1]/child[1]/child[2]/child[0]/child[0]/child[0]/child[0] kind=text data="x" +NODE path=/root[0]/child[1]/child[1]/child[3] kind=text data="\n" diff --git a/crates/html/tests/fixtures/html5/conformance/template-state-eof/fixture.toml b/crates/html/tests/fixtures/html5/conformance/template-state-eof/fixture.toml index e126a2fc..d9147212 100644 --- a/crates/html/tests/fixtures/html5/conformance/template-state-eof/fixture.toml +++ b/crates/html/tests/fixtures/html5/conformance/template-state-eof/fixture.toml @@ -21,6 +21,8 @@ unit = "unicode-scalars" strategy = "boundaries" boundaries = [1] [expectations] +tree = "tree.txt" +patches = "patches.txt" final_invariants = "final-invariants.txt" [disposition] status = "active" diff --git a/crates/html/tests/fixtures/html5/conformance/template-state-eof/patches.txt b/crates/html/tests/fixtures/html5/conformance/template-state-eof/patches.txt new file mode 100644 index 00000000..1684153a --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/template-state-eof/patches.txt @@ -0,0 +1,28 @@ +# format: html5-dompatch-v3 +PATCH operation=1 kind=create-document node="node-1" legacy-doctype=null +PATCH operation=2 kind=create-document-type node="node-2" name="html" public-id=null system-id=null +PATCH operation=3 kind=append-child parent="node-1" child="node-2" +PATCH operation=4 kind=create-element node="node-3" namespace=html local-name="html" +PATCH operation=5 kind=append-child parent="node-1" child="node-3" +PATCH operation=6 kind=create-element node="node-4" namespace=html local-name="head" +PATCH operation=7 kind=append-child parent="node-3" child="node-4" +PATCH operation=8 kind=create-element node="node-5" namespace=html local-name="template" +PATCH operation=9 kind=create-template-contents host="node-5" contents="node-6" +PATCH operation=10 kind=append-child parent="node-4" child="node-5" +PATCH operation=11 kind=create-element node="node-7" namespace=html local-name="table" +PATCH operation=12 kind=append-child parent="node-6" child="node-7" +PATCH operation=13 kind=create-element node="node-8" namespace=html local-name="tbody" +PATCH operation=14 kind=append-child parent="node-7" child="node-8" +PATCH operation=15 kind=create-element node="node-9" namespace=html local-name="tr" +PATCH operation=16 kind=append-child parent="node-8" child="node-9" +PATCH operation=17 kind=create-element node="node-10" namespace=html local-name="td" +PATCH operation=18 kind=append-child parent="node-9" child="node-10" +PATCH operation=19 kind=create-text node="node-11" text="x" +PATCH operation=20 kind=append-child parent="node-10" child="node-11" +PATCH operation=21 kind=create-element node="node-12" namespace=html local-name="template" +PATCH operation=22 kind=create-template-contents host="node-12" contents="node-13" +PATCH operation=23 kind=append-child parent="node-10" child="node-12" +PATCH operation=24 kind=create-text node="node-14" text="y\n" +PATCH operation=25 kind=append-child parent="node-13" child="node-14" +PATCH operation=26 kind=create-element node="node-15" namespace=html local-name="body" +PATCH operation=27 kind=append-child parent="node-3" child="node-15" diff --git a/crates/html/tests/fixtures/html5/conformance/template-state-eof/tree.txt b/crates/html/tests/fixtures/html5/conformance/template-state-eof/tree.txt new file mode 100644 index 00000000..242c8c43 --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/template-state-eof/tree.txt @@ -0,0 +1,16 @@ +# format: html5-dom-v3 +NODE path=/root[0] kind=document +NODE path=/root[0]/child[0] kind=document-type name="html" public-id=null system-id=null +NODE path=/root[0]/child[1] kind=element namespace=html local-name="html" +NODE path=/root[0]/child[1]/child[0] kind=element namespace=html local-name="head" +NODE path=/root[0]/child[1]/child[0]/child[0] kind=html-template-host +TEMPLATE_CONTENTS path=/root[0]/child[1]/child[0]/child[0]/contents host=/root[0]/child[1]/child[0]/child[0] +NODE path=/root[0]/child[1]/child[0]/child[0]/contents/child[0] kind=element namespace=html local-name="table" +NODE path=/root[0]/child[1]/child[0]/child[0]/contents/child[0]/child[0] kind=element namespace=html local-name="tbody" +NODE path=/root[0]/child[1]/child[0]/child[0]/contents/child[0]/child[0]/child[0] kind=element namespace=html local-name="tr" +NODE path=/root[0]/child[1]/child[0]/child[0]/contents/child[0]/child[0]/child[0]/child[0] kind=element namespace=html local-name="td" +NODE path=/root[0]/child[1]/child[0]/child[0]/contents/child[0]/child[0]/child[0]/child[0]/child[0] kind=text data="x" +NODE path=/root[0]/child[1]/child[0]/child[0]/contents/child[0]/child[0]/child[0]/child[0]/child[1] kind=html-template-host +TEMPLATE_CONTENTS path=/root[0]/child[1]/child[0]/child[0]/contents/child[0]/child[0]/child[0]/child[0]/child[1]/contents host=/root[0]/child[1]/child[0]/child[0]/contents/child[0]/child[0]/child[0]/child[0]/child[1] +NODE path=/root[0]/child[1]/child[0]/child[0]/contents/child[0]/child[0]/child[0]/child[0]/child[1]/contents/child[0] kind=text data="y\n" +NODE path=/root[0]/child[1]/child[1] kind=element namespace=html local-name="body" diff --git a/crates/html/tests/fixtures/html5/conformance/tokenizer-eof-recovery/fixture.toml b/crates/html/tests/fixtures/html5/conformance/tokenizer-eof-recovery/fixture.toml index 29f14414..2175f83f 100644 --- a/crates/html/tests/fixtures/html5/conformance/tokenizer-eof-recovery/fixture.toml +++ b/crates/html/tests/fixtures/html5/conformance/tokenizer-eof-recovery/fixture.toml @@ -21,6 +21,8 @@ unit = "unicode-scalars" strategy = "boundaries" boundaries = [1] [expectations] +tokens = "tokens.txt" +parse_errors = "parse-errors.txt" final_invariants = "final-invariants.txt" [disposition] status = "active" diff --git a/crates/html/tests/fixtures/html5/conformance/tokenizer-eof-recovery/parse-errors.txt b/crates/html/tests/fixtures/html5/conformance/tokenizer-eof-recovery/parse-errors.txt new file mode 100644 index 00000000..9877d0ba --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/tokenizer-eof-recovery/parse-errors.txt @@ -0,0 +1,2 @@ +# format: html5-parse-errors-v1 +PARSE_ERROR occurrence=1 stage=tokenizer code=standard:eof-in-comment recovery=emit-current-comment-at-eof position=normalized-utf8:37:2:1:source-unavailable:no-input-provenance-map context=absent context-token=null context-mode=null context-namespace=null diff --git a/crates/html/tests/fixtures/html5/conformance/tokenizer-eof-recovery/tokens.txt b/crates/html/tests/fixtures/html5/conformance/tokenizer-eof-recovery/tokens.txt new file mode 100644 index 00000000..d272858d --- /dev/null +++ b/crates/html/tests/fixtures/html5/conformance/tokenizer-eof-recovery/tokens.txt @@ -0,0 +1,4 @@ +# format: html5-token-v2 +TOKEN ordinal=1 kind=doctype name="html" public-id=null system-id=null force-quirks=false +TOKEN ordinal=2 kind=comment data="open