summaryrefslogtreecommitdiff
path: root/test/js/dom-node-parentNode.html
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2015-10-21 18:55:39 +0200
committerDaniel Silverstone <dsilvers@digital-scurf.org>2015-10-21 18:55:39 +0200
commitc752c85618a57f8c82dc2e939ba2bf735e6c8372 (patch)
treec4040c3838a22169043927577f0ae8cd3793708f /test/js/dom-node-parentNode.html
parent2f52338328e694e3ba1141424cbf3f413bcfbaf9 (diff)
downloadnetsurf-c752c85618a57f8c82dc2e939ba2bf735e6c8372.tar.gz
netsurf-c752c85618a57f8c82dc2e939ba2bf735e6c8372.tar.bz2
Correct some incorrect error case handling and add tests to demonstrate fix
Diffstat (limited to 'test/js/dom-node-parentNode.html')
-rw-r--r--test/js/dom-node-parentNode.html23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/js/dom-node-parentNode.html b/test/js/dom-node-parentNode.html
new file mode 100644
index 000000000..927a3701b
--- /dev/null
+++ b/test/js/dom-node-parentNode.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head><title>DOM Node::nodeType</title></head>
+<body>
+<h1>Node::ParentNode</h1>
+<h2>These should all resolve to nodes of some kind.</h2>
+<script>
+document.write("<p>document is: ",
+ document, "</p>");
+document.write("<p>document.body is: ",
+ document.body, "</p>");
+document.write("<p>document.body.parentNode: ",
+ document.body.parentNode, "</p>");
+</script>
+<h2>These should all resolve to null.</h2>
+<script>
+document.write("<p>document.parentNode is: ",
+ document.parentNode, "</p>");
+document.write("<p>document.createElement('foo').parentNode is: ",
+ document.createElement('foo').parentNode, "</p>");
+</script>
+</body>
+</html>