Node-childNodes-cache.html (1077B)
1 <!DOCTYPE html> 2 <meta charset=utf-8> 3 <title>Node.childNodes caching bug</title> 4 <link rel=help href="https://bugzilla.mozilla.org/show_bug.cgi?id=1919031"> 5 <link rel=author title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> 6 <link rel=author title="Mozilla" href="https://mozilla.org"> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <div id="target"><div id="first"></div><div id="second"></div><div id="third"></div><div id="last"></div></div> 10 <script> 11 test(function() { 12 let target = document.getElementById("target"); 13 let second = target.childNodes[1]; 14 assert_equals(second.id, "second"); 15 second.remove(); 16 assert_equals(target.childNodes[4], undefined, "Out of bounds elements are undefined"); 17 assert_equals(target.childNodes[3], undefined, "Out of bounds elements are undefined"); 18 assert_equals(target.childNodes.length, 3); 19 assert_equals(target.childNodes[0].id, "first"); 20 assert_equals(target.childNodes[1].id, "third"); 21 assert_equals(target.childNodes[2].id, "last"); 22 }); 23 </script>