From 0d0b3c2c38dc020f0b1d440348d954a47e846779 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 25 Jun 2026 16:11:48 +0200 Subject: [PATCH] Tree construction tests have moved to WPT Helps with #127. --- README.md | 3 + tree-construction/README.md | 108 - tree-construction/adoption01.dat | 354 --- tree-construction/adoption02.dat | 56 - tree-construction/blocks.dat | 695 ----- tree-construction/comments01.dat | 217 -- tree-construction/doctype01.dat | 474 --- tree-construction/domjs-unsafe.dat | Bin 10356 -> 0 bytes tree-construction/entities01.dat | 943 ------ tree-construction/entities02.dat | 309 -- tree-construction/foreign-fragment.dat | 645 ---- tree-construction/html5test-com.dat | 301 -- tree-construction/inbody01.dat | 54 - tree-construction/isindex.dat | 49 - tree-construction/main-element.dat | 46 - tree-construction/math.dat | 104 - tree-construction/menuitem-element.dat | 241 -- tree-construction/namespace-sensitivity.dat | 22 - tree-construction/noscript01.dat | 237 -- ...pending-spec-changes-plain-text-unsafe.dat | Bin 927 -> 0 bytes tree-construction/pending-spec-changes.dat | 46 - tree-construction/plain-text-unsafe.dat | Bin 9486 -> 0 bytes tree-construction/quirks01.dat | 53 - tree-construction/ruby.dat | 302 -- tree-construction/scriptdata01.dat | 372 --- tree-construction/scripted/adoption01.dat | 16 - tree-construction/scripted/ark.dat | 27 - tree-construction/scripted/webkit01.dat | 30 - tree-construction/search-element.dat | 46 - tree-construction/svg.dat | 104 - tree-construction/tables01.dat | 323 -- tree-construction/template.dat | 1673 ----------- tree-construction/tests1.dat | 1958 ------------- tree-construction/tests10.dat | 853 ------ tree-construction/tests11.dat | 523 ---- tree-construction/tests12.dat | 62 - tree-construction/tests14.dat | 75 - tree-construction/tests15.dat | 216 -- tree-construction/tests16.dat | 2602 ----------------- tree-construction/tests17.dat | 177 -- tree-construction/tests18.dat | 572 ---- tree-construction/tests19.dat | 1398 --------- tree-construction/tests2.dat | 831 ------ tree-construction/tests20.dat | 842 ------ tree-construction/tests21.dat | 306 -- tree-construction/tests22.dat | 190 -- tree-construction/tests23.dat | 168 -- tree-construction/tests24.dat | 79 - tree-construction/tests25.dat | 288 -- tree-construction/tests26.dat | 453 --- tree-construction/tests3.dat | 305 -- tree-construction/tests4.dat | 74 - tree-construction/tests5.dat | 210 -- tree-construction/tests6.dat | 663 ----- tree-construction/tests7.dat | 453 --- tree-construction/tests8.dat | 165 -- tree-construction/tests9.dat | 482 --- tree-construction/tests_innerHTML_1.dat | 844 ------ tree-construction/tricky01.dat | 336 --- tree-construction/void-in-phrasing.dat | 151 - tree-construction/webkit01.dat | 783 ----- tree-construction/webkit02.dat | 775 ----- 62 files changed, 3 insertions(+), 24681 deletions(-) create mode 100644 README.md delete mode 100644 tree-construction/README.md delete mode 100644 tree-construction/adoption01.dat delete mode 100644 tree-construction/adoption02.dat delete mode 100644 tree-construction/blocks.dat delete mode 100644 tree-construction/comments01.dat delete mode 100644 tree-construction/doctype01.dat delete mode 100644 tree-construction/domjs-unsafe.dat delete mode 100644 tree-construction/entities01.dat delete mode 100644 tree-construction/entities02.dat delete mode 100644 tree-construction/foreign-fragment.dat delete mode 100644 tree-construction/html5test-com.dat delete mode 100644 tree-construction/inbody01.dat delete mode 100644 tree-construction/isindex.dat delete mode 100644 tree-construction/main-element.dat delete mode 100644 tree-construction/math.dat delete mode 100644 tree-construction/menuitem-element.dat delete mode 100644 tree-construction/namespace-sensitivity.dat delete mode 100644 tree-construction/noscript01.dat delete mode 100644 tree-construction/pending-spec-changes-plain-text-unsafe.dat delete mode 100644 tree-construction/pending-spec-changes.dat delete mode 100644 tree-construction/plain-text-unsafe.dat delete mode 100644 tree-construction/quirks01.dat delete mode 100644 tree-construction/ruby.dat delete mode 100644 tree-construction/scriptdata01.dat delete mode 100644 tree-construction/scripted/adoption01.dat delete mode 100644 tree-construction/scripted/ark.dat delete mode 100644 tree-construction/scripted/webkit01.dat delete mode 100644 tree-construction/search-element.dat delete mode 100644 tree-construction/svg.dat delete mode 100644 tree-construction/tables01.dat delete mode 100644 tree-construction/template.dat delete mode 100644 tree-construction/tests1.dat delete mode 100644 tree-construction/tests10.dat delete mode 100644 tree-construction/tests11.dat delete mode 100644 tree-construction/tests12.dat delete mode 100644 tree-construction/tests14.dat delete mode 100644 tree-construction/tests15.dat delete mode 100644 tree-construction/tests16.dat delete mode 100644 tree-construction/tests17.dat delete mode 100644 tree-construction/tests18.dat delete mode 100644 tree-construction/tests19.dat delete mode 100644 tree-construction/tests2.dat delete mode 100644 tree-construction/tests20.dat delete mode 100644 tree-construction/tests21.dat delete mode 100644 tree-construction/tests22.dat delete mode 100644 tree-construction/tests23.dat delete mode 100644 tree-construction/tests24.dat delete mode 100644 tree-construction/tests25.dat delete mode 100644 tree-construction/tests26.dat delete mode 100644 tree-construction/tests3.dat delete mode 100644 tree-construction/tests4.dat delete mode 100644 tree-construction/tests5.dat delete mode 100644 tree-construction/tests6.dat delete mode 100644 tree-construction/tests7.dat delete mode 100644 tree-construction/tests8.dat delete mode 100644 tree-construction/tests9.dat delete mode 100644 tree-construction/tests_innerHTML_1.dat delete mode 100644 tree-construction/tricky01.dat delete mode 100644 tree-construction/void-in-phrasing.dat delete mode 100644 tree-construction/webkit01.dat delete mode 100644 tree-construction/webkit02.dat diff --git a/README.md b/README.md new file mode 100644 index 00000000..54556b70 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +The HTML parser tree construction tests are now solely maintained on web-platform-tests: + + https://github.com/web-platform-tests/wpt/tree/master/html/syntax/parsing diff --git a/tree-construction/README.md b/tree-construction/README.md deleted file mode 100644 index 4737a3a8..00000000 --- a/tree-construction/README.md +++ /dev/null @@ -1,108 +0,0 @@ -Tree Construction Tests -======================= - -Each file containing tree construction tests consists of any number of -tests separated by two newlines (LF) and a single newline before the end -of the file. For instance: - - [TEST]LF - LF - [TEST]LF - LF - [TEST]LF - -Where [TEST] is the following format: - -Each test must begin with a string "\#data" followed by a newline (LF). -All subsequent lines until a line that says "\#errors" are the test data -and must be passed to the system being tested unchanged, except with the -final newline (on the last line) removed. - -Then there must be a line that says "\#errors". It must be followed by -one line per parse error that a conformant checker would return. It -doesn't matter what those lines are, although they can't be -"\#new-errors", "\#document-fragment", "\#document", "\#script-off", -"\#script-on", or empty, the only thing that matters is that there be -the right number of parse errors. - -Then there \*may\* be a line that says "\#new-errors", which works like -the "\#errors" section adding more errors to the expected number of -errors. - -Then there \*may\* be a line that says "\#document-fragment", which must -be followed by a newline (LF), followed by a string of characters that -indicates the context element, followed by a newline (LF). If the string -of characters starts with "svg ", the context element is in the SVG -namespace and the substring after "svg " is the local name. If the -string of characters starts with "math ", the context element is in the -MathML namespace and the substring after "math " is the local name. -Otherwise, the context element is in the HTML namespace and the string -is the local name. If this line is present the "\#data" must be parsed -using the HTML fragment parsing algorithm with the context element as -context. - -Then there \*may\* be a line that says "\#script-off" or -"\#script-on". If a line that says "\#script-off" is present, the -parser must set the scripting flag to disabled. If a line that says -"\#script-on" is present, it must set it to enabled. Otherwise, the -test should be run in both modes. - -Then there must be a line that says "\#document", which must be followed -by a dump of the tree of the parsed DOM. Each node must be represented -by a single line. Each line must start with "| ", followed by two spaces -per parent node that the node has before the root document node. - -- Element nodes must be represented by a "`<`" then the *tag name - string* "`>`", and all the attributes must be given, sorted - lexicographically by UTF-16 code unit according to their *attribute - name string*, on subsequent lines, as if they were children of the - element node. -- Attribute nodes must have the *attribute name string*, then an "=" - sign, then the attribute value in double quotes ("). -- Text nodes must be the string, in double quotes. Newlines aren't - escaped. -- Comments must be "`<`" then "`!-- `" then the data then "` -->`". -- DOCTYPEs must be "``". -- Processing instructions must be "``". (The HTML parser cannot emit - processing instructions, but scripts can, and the WebVTT to DOM - rules can emit them.) -- Template contents are represented by the string "content" with the - children below it. - -The *tag name string* is the local name prefixed by a namespace -designator. For the HTML namespace, the namespace designator is the -empty string, i.e. there's no prefix. For the SVG namespace, the -namespace designator is "svg ". For the MathML namespace, the namespace -designator is "math ". - -The *attribute name string* is the local name prefixed by a namespace -designator. For no namespace, the namespace designator is the empty -string, i.e. there's no prefix. For the XLink namespace, the namespace -designator is "xlink ". For the XML namespace, the namespace designator -is "xml ". For the XMLNS namespace, the namespace designator is "xmlns -". Note the difference between "xlink:href" which is an attribute in no -namespace with the local name "xlink:href" and "xlink href" which is an -attribute in the xlink namespace with the local name "href". - -If there is also a "\#document-fragment" the bit following "\#document" -must be a representation of the HTML fragment serialization for the -context element given by "\#document-fragment". - -For example: - - #data -

One

Two - #errors - 3: Missing document type declaration - #document - | - | - | - |

- | "One" - |

- | "Two" diff --git a/tree-construction/adoption01.dat b/tree-construction/adoption01.dat deleted file mode 100644 index 38f98efd..00000000 --- a/tree-construction/adoption01.dat +++ /dev/null @@ -1,354 +0,0 @@ -#data -

-#errors -(1,3): expected-doctype-but-got-start-tag -(1,10): adoption-agency-1.3 -#document -| -| -| -| -|

-| - -#data -1

23

-#errors -(1,3): expected-doctype-but-got-start-tag -(1,12): adoption-agency-1.3 -#document -| -| -| -| -| "1" -|

-| -| "2" -| "3" - -#data -1 -#errors -(1,3): expected-doctype-but-got-start-tag -(1,17): adoption-agency-1.3 -#document -| -| -| -| -| "1" -|