diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/js/dom-node-nodetype.html | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/js/dom-node-nodetype.html b/test/js/dom-node-nodetype.html new file mode 100644 index 000000000..50e319a6c --- /dev/null +++ b/test/js/dom-node-nodetype.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> +<head><title>Inline Script Simple Document Write</title></head> +<body> +<h1>Node::nodeType</h1> +<h2>These should all resolve to true.</h2> +<script> +document.write("<p>document is Node.DOCUMENT_NODE: ", + document.nodeType === Node.DOCUMENT_NODE, "</p>"); +document.write("<p>document.body is Node.ELEMENT_NODE: ", + document.body.nodeType === Node.ELEMENT_NODE, "</p>"); +document.write("<p>document.body.firstChild is Node.TEXT_NODE: ", + document.body.firstChild.nodeType === Node.TEXT_NODE, "</p>"); +document.write("<p>document.body.firstChild.nextSibling is Node.ELEMENT_NODE: ", + document.body.firstChild.nextSibling.nodeType === Node.ELEMENT_NODE, "</p>"); +document.write("<p>document.body.firstChild.nextSibling.firstChild is Node.TEXT_NODE: ", + document.body.firstChild.nextSibling.firstChild.nodeType === Node.TEXT_NODE, "</p>"); +</script> +<h2>These should all resolve to false.</h2> +<script> +document.write("<p>document is Node.ELEMENT_NODE: ", + document.nodeType === Node.ELEMENT_NODE, "</p>"); +document.write("<p>document.body is Node.TEXT_NODE: ", + document.body.nodeType === Node.TEXT_NODE, "</p>"); +document.write("<p>document.body.firstChild is Node.ELEMENT_NODE: ", + document.body.firstChild.nodeType === Node.ELEMENT_NODE, "</p>"); +document.write("<p>document.body.firstChild.nextSibling is Node.DOCUMENT_NODE: ", + document.body.firstChild.nextSibling.nodeType === Node.DOCUMENT_NODE, "</p>"); +document.write("<p>document.body.firstChild.nextSibling.firstChild is Node.ELEMENT_NODE: ", + document.body.firstChild.nextSibling.firstChild.nodeType === Node.ELEMENT_NODE, "</p>"); +</script> +</body> +</html> |