summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2015-08-11 17:21:08 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2015-08-11 17:21:08 +0100
commit78c5ab6f9f0f52a16b999659ea5561d2387e9685 (patch)
treee3b9ffddcf1d0b865982e26622cd4885038812ba /test
parente91255b4095ca2429c3ace40e2758ec56723dbc8 (diff)
downloadnetsurf-78c5ab6f9f0f52a16b999659ea5561d2387e9685.tar.gz
netsurf-78c5ab6f9f0f52a16b999659ea5561d2387e9685.tar.bz2
Add Node::nodeType test.
Diffstat (limited to 'test')
-rw-r--r--test/js/dom-node-nodetype.html33
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>