summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2016-02-01 20:50:42 +0000
committerJohn-Mark Bell <jmb@netsurf-browser.org>2016-02-01 20:50:42 +0000
commit25b88e42e6160c163f36f69226b4781c2fb56c92 (patch)
tree9a8062f8f971629fb6334a3e9d2f3bac4336fbd5 /test
parent9fb755b7544c6a618a260f5c1a6c8724265bf735 (diff)
downloadnetsurf-25b88e42e6160c163f36f69226b4781c2fb56c92.tar.gz
netsurf-25b88e42e6160c163f36f69226b4781c2fb56c92.tar.bz2
Test for [TreatNullAs=EmptyString]
Diffstat (limited to 'test')
-rw-r--r--test/js/idl-treatnullas-emptystring.html24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/js/idl-treatnullas-emptystring.html b/test/js/idl-treatnullas-emptystring.html
new file mode 100644
index 000000000..386e6072a
--- /dev/null
+++ b/test/js/idl-treatnullas-emptystring.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Ensure that [TreatNullAs=EmptyString] works correctly</title>
+<link rel="stylesheet" type="text/css" href="tst.css">
+</head>
+<body text="blue">
+<h1>Ensure that [TreatNullAs=EmptyString] works correctly</h1>
+
+<script>
+ var e = document.createElement("p");
+ var t = document.createTextNode("Initial body text:\""+document.body.text+"\" (should be \"blue\")");
+ e.appendChild(t);
+ document.body.appendChild(e);
+
+ document.body.text = null;
+ var e2 = document.createElement("p");
+ var t2 = document.createTextNode("New body text:\""+document.body.text+"\" (should be \"\")");
+ e2.appendChild(t2);
+ document.body.appendChild(e2);
+</script>
+
+</body>
+</html>