summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2015-10-29 16:55:42 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2015-10-29 16:55:42 +0000
commit396b445599731cceb7173bdc2336ccc1e59871a7 (patch)
treef0298a7e9e04d3859c79ba8715ce2d5d3222b998 /test
parent0fabb20cc59ee16441e037867675093200f4b378 (diff)
downloadnetsurf-396b445599731cceb7173bdc2336ccc1e59871a7.tar.gz
netsurf-396b445599731cceb7173bdc2336ccc1e59871a7.tar.bz2
Add failing test.
1. Add "id" attribute. 2. Remove "ID" attribute. 3. Check id value. In NetSurf it isn't removed, in Firefox it is. There's a case sensitivity/conversion issue somewhere. It the test works when we add/remove with the same case.
Diffstat (limited to 'test')
-rw-r--r--test/js/dom-element-attribute.html26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/js/dom-element-attribute.html b/test/js/dom-element-attribute.html
new file mode 100644
index 000000000..b38218ab0
--- /dev/null
+++ b/test/js/dom-element-attribute.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>element set remove attribute</title>
+<link rel="stylesheet" type="text/css" href="tst.css">
+</head>
+<body>
+<h1>HTMLElement test of attribute set/remove</h1>
+
+<script>
+ var e = document.createElement("Div");
+ var t = document.createTextNode("Some text in a div.");
+ e.appendChild(t);
+ e.setAttribute("id", "test");
+ document.body.appendChild(e);
+</script>
+<script>
+ var test = document.getElementById("test");
+ document.write("<p>The div has id: ''", test.id, "''.</p>");
+ document.write("<p>Removing ID attribute...");
+ test.removeAttribute("ID");
+ document.write("<p>The div has id: ''", test.id, "''.</p>");
+</script>
+
+</body>
+</html>