Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion crates/html/tests/fixtures/html5/conformance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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."
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html>lead<p>ok</p>
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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."
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!--x-->
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# format: html5-document-mode-v1
MODE value=limited-quirks
Original file line number Diff line number Diff line change
@@ -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."
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# format: html5-document-mode-v1
MODE value=no-quirks
Original file line number Diff line number Diff line change
@@ -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."
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# format: html5-document-mode-v1
MODE value=quirks
Original file line number Diff line number Diff line change
@@ -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."
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype foo>
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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."
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<svg><g><p>x</p></svg><div>after
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ unit = "unicode-scalars"
strategy = "boundaries"
boundaries = [1]
[expectations]
tree = "tree.txt"
final_invariants = "final-invariants.txt"
[disposition]
status = "active"
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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."
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<svg viewbox="0 0 1 1" xlink:href="outer" xml:lang="en" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path attributename="d" href="plain" xlink:href="qualified"/></svg>
Original file line number Diff line number Diff line change
@@ -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"
Loading
Loading