From 50422eb563caba2e651ac3d2c6920fe3bc9bdd29 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Fri, 18 Jul 2025 13:21:33 -0600 Subject: [PATCH] Tests: Add XHTML tests for CDATA, PIs and Comment nodes in the DOM --- .../XHTML/CDATASection-PI-Comment-Nodes.txt | 4 +++ .../cssom/xml-stylesheet-pi-in-doctype.txt | 6 ++++ .../dom/nodes/Comment-in-doctype.txt | 6 ++++ .../dom/nodes/Node-lookupPrefix.txt | 16 ++++++++++ .../ProcessingInstruction-in-doctype.txt | 6 ++++ .../XHTML/CDATASection-PI-Comment-Nodes.xhtml | 16 ++++++++++ .../cssom/xml-stylesheet-pi-in-doctype.xhtml | 17 ++++++++++ .../dom/nodes/Comment-in-doctype.xhtml | 15 +++++++++ .../dom/nodes/Node-lookupPrefix.xhtml | 31 +++++++++++++++++++ .../ProcessingInstruction-in-doctype.xhtml | 15 +++++++++ 10 files changed, 132 insertions(+) create mode 100644 Tests/LibWeb/Text/expected/XHTML/CDATASection-PI-Comment-Nodes.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/cssom/xml-stylesheet-pi-in-doctype.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/dom/nodes/Comment-in-doctype.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/dom/nodes/Node-lookupPrefix.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/dom/nodes/ProcessingInstruction-in-doctype.txt create mode 100644 Tests/LibWeb/Text/input/XHTML/CDATASection-PI-Comment-Nodes.xhtml create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/cssom/xml-stylesheet-pi-in-doctype.xhtml create mode 100644 Tests/LibWeb/Text/input/wpt-import/dom/nodes/Comment-in-doctype.xhtml create mode 100644 Tests/LibWeb/Text/input/wpt-import/dom/nodes/Node-lookupPrefix.xhtml create mode 100644 Tests/LibWeb/Text/input/wpt-import/dom/nodes/ProcessingInstruction-in-doctype.xhtml diff --git a/Tests/LibWeb/Text/expected/XHTML/CDATASection-PI-Comment-Nodes.txt b/Tests/LibWeb/Text/expected/XHTML/CDATASection-PI-Comment-Nodes.txt new file mode 100644 index 00000000000..e8ea08da0a1 --- /dev/null +++ b/Tests/LibWeb/Text/expected/XHTML/CDATASection-PI-Comment-Nodes.txt @@ -0,0 +1,4 @@ +elem.childNodes.length: 5 +child node 0: [object CDATASection], 4 +child node 1 [object ProcessingInstruction], 7 +child node 2: [object Comment], 8 diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/cssom/xml-stylesheet-pi-in-doctype.txt b/Tests/LibWeb/Text/expected/wpt-import/css/cssom/xml-stylesheet-pi-in-doctype.txt new file mode 100644 index 00000000000..56c31fe8d75 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/cssom/xml-stylesheet-pi-in-doctype.txt @@ -0,0 +1,6 @@ +Harness status: OK + +Found 1 tests + +1 Pass +Pass xml-stylesheet processing instruction in doctype internal subset \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/nodes/Comment-in-doctype.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/nodes/Comment-in-doctype.txt new file mode 100644 index 00000000000..50846a14c8c --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/nodes/Comment-in-doctype.txt @@ -0,0 +1,6 @@ +Harness status: OK + +Found 1 tests + +1 Fail +Fail XML: Comment in doctype internal subset \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/nodes/Node-lookupPrefix.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/nodes/Node-lookupPrefix.txt new file mode 100644 index 00000000000..1e982f4b96f --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/nodes/Node-lookupPrefix.txt @@ -0,0 +1,16 @@ +Harness status: OK + +Found 11 tests + +11 Pass +Pass Node.lookupPrefix +Pass Node.lookupPrefix 1 +Pass Node.lookupPrefix 2 +Pass Node.lookupPrefix 3 +Pass Node.lookupPrefix 4 +Pass Node.lookupPrefix 5 +Pass Node.lookupPrefix 6 +Pass Node.lookupPrefix 7 +Pass Node.lookupPrefix 8 +Pass Node.lookupPrefix 9 +Pass Node.lookupPrefix 10 \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/nodes/ProcessingInstruction-in-doctype.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/nodes/ProcessingInstruction-in-doctype.txt new file mode 100644 index 00000000000..0f68c18f851 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/nodes/ProcessingInstruction-in-doctype.txt @@ -0,0 +1,6 @@ +Harness status: OK + +Found 1 tests + +1 Pass +Pass XML: Processing instruction in doctype internal subset \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/XHTML/CDATASection-PI-Comment-Nodes.xhtml b/Tests/LibWeb/Text/input/XHTML/CDATASection-PI-Comment-Nodes.xhtml new file mode 100644 index 00000000000..d2fade4f313 --- /dev/null +++ b/Tests/LibWeb/Text/input/XHTML/CDATASection-PI-Comment-Nodes.xhtml @@ -0,0 +1,16 @@ + + + +

Hello

World

+ + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/cssom/xml-stylesheet-pi-in-doctype.xhtml b/Tests/LibWeb/Text/input/wpt-import/css/cssom/xml-stylesheet-pi-in-doctype.xhtml new file mode 100644 index 00000000000..80f8704a03f --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/cssom/xml-stylesheet-pi-in-doctype.xhtml @@ -0,0 +1,17 @@ +]> + + + xml-stylesheet processing instruction in doctype internal subset + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Comment-in-doctype.xhtml b/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Comment-in-doctype.xhtml new file mode 100644 index 00000000000..95050c7715c --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Comment-in-doctype.xhtml @@ -0,0 +1,15 @@ +]> + + XML: Comment in doctype internal subset + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Node-lookupPrefix.xhtml b/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Node-lookupPrefix.xhtml new file mode 100644 index 00000000000..26198642df7 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Node-lookupPrefix.xhtml @@ -0,0 +1,31 @@ + + +Node.lookupPrefix + + + + +
+TEST + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/nodes/ProcessingInstruction-in-doctype.xhtml b/Tests/LibWeb/Text/input/wpt-import/dom/nodes/ProcessingInstruction-in-doctype.xhtml new file mode 100644 index 00000000000..b6cffd6782f --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/nodes/ProcessingInstruction-in-doctype.xhtml @@ -0,0 +1,15 @@ +]> + + XML: Processing instruction in doctype internal subset + + + + + + +