Tests: Add XHTML tests for CDATA, PIs and Comment nodes in the DOM

This commit is contained in:
Andrew Kaster 2025-07-18 13:21:33 -06:00 committed by Ali Mohammad Pur
commit 50422eb563
Notes: github-actions[bot] 2025-07-19 12:57:25 +00:00
10 changed files with 132 additions and 0 deletions

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<body>
<div id="elem"><![CDATA[beep]]><?test test?><!-- I am a comment --><p>Hello</p><p>World</p></div>
<script src="../include.js"></script>
<script>
test(() => {
const elem = document.getElementById("elem");
println(`elem.childNodes.length: ${elem.childNodes.length}`);
println(`child node 0: ${elem.childNodes[0].toString()}, ${elem.childNodes[0].nodeType}`);
println(`child node 1 ${elem.childNodes[1].toString()}, ${elem.childNodes[1].nodeType}`);
println(`child node 2: ${elem.childNodes[2].toString()}, ${elem.childNodes[2].nodeType}`);
});
</script>
</body>
</html>