1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/html/document/test/test_bug259332.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,64 @@ 1.4 +<html> 1.5 +<!-- 1.6 +https://bugzilla.mozilla.org/show_bug.cgi?id=259332 1.7 +--> 1.8 +<head> 1.9 + <title>Test for Bug 259332</title> 1.10 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.11 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.12 +</head> 1.13 +<body> 1.14 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=259332">Mozilla Bug 259332</a> 1.15 +<p id="display"></p> 1.16 +<div id="content"> 1.17 + <div id="a">a 1.18 + <div id="a">a</div> 1.19 + <input name="a" value="a"> 1.20 + <div id="b">b</div> 1.21 + <input name="b" value="b"> 1.22 + <div id="c">c</div> 1.23 + </div> 1.24 + <input name="write"> 1.25 + <input name="write"> 1.26 + <input id="write"> 1.27 +</div> 1.28 +<pre id="test"> 1.29 +<script class="testbody" type="text/javascript"> 1.30 + 1.31 +/** Test for Bug 259332 **/ 1.32 + 1.33 +list = document.all.a; 1.34 +ok(list.length == 3, "initial a length"); 1.35 + 1.36 +blist = document.all.b; 1.37 +ok(document.all.b.length == 2, "initial b length"); 1.38 +document.getElementById('b').id = 'a'; 1.39 +ok(document.all.b.nodeName == "INPUT", "just one b"); 1.40 + 1.41 +ok(blist.length == 1, "just one b"); 1.42 +ok(list.length == 4, "one more a"); 1.43 + 1.44 +newDiv = document.createElement('div'); 1.45 +newDiv.id = 'a'; 1.46 +newDiv.innerHTML = 'a'; 1.47 +list[0].appendChild(newDiv); 1.48 +ok(list.length == 5, "two more a"); 1.49 + 1.50 +ok(document.all.c.textContent == 'c', "one c"); 1.51 +document.all.c.id = 'a'; 1.52 +ok(!document.all.c, "no c"); 1.53 +ok(list.length == 6, "three more a"); 1.54 + 1.55 +ok(document.all.write.length == 3, "name is write"); 1.56 + 1.57 +newDiv = document.createElement('div'); 1.58 +newDiv.id = 'd'; 1.59 +newDiv.innerHTML = 'd'; 1.60 +list[0].appendChild(newDiv); 1.61 +ok(document.all.d.textContent == 'd', "new d"); 1.62 + 1.63 + 1.64 +</script> 1.65 +</pre> 1.66 +</body> 1.67 +</html>