test_bug698381.html (1845B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=698381 5 --> 6 <head> 7 <title>Test for Bug 698381</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <script src="/tests/SimpleTest/EventUtils.js" 10 type="text/javascript"></script> 11 <link rel="stylesheet" type="text/css" 12 href="/tests/SimpleTest/test.css" /> 13 </head> 14 <body onload="runTests();"> 15 <a target="_blank" 16 href="https://bugzilla.mozilla.org/show_bug.cgi?id=698381"> 17 Mozilla Bug 698381</a> 18 <p id="display"></p> 19 <div id="content" style="display: none"></div> 20 <div id="noChildren" style="display: none"></div> 21 <div id="hasChildren" style="display: none"> 22 <div id="childOne" style="display: none"></div> 23 </div> 24 <pre id="test"> 25 <script type="text/javascript"> 26 /* 27 Checks to see if default parameter handling is correct when 0 28 parameters are passed. 29 30 If none are passed, then Node.cloneNode should default aDeep 31 to true. 32 */ 33 SimpleTest.waitForExplicitFinish(); 34 35 var hasChildren = document.getElementById("hasChildren"), 36 noChildren = document.getElementById("noChildren"), 37 clonedNode; 38 39 function runTests() { 40 41 // Test Node.cloneNode when no arguments are given 42 clonedNode = hasChildren.cloneNode(); 43 is(clonedNode.hasChildNodes(), false, "Node.cloneNode with false " + 44 "default on a node with children does not clone the child nodes."); 45 46 clonedNode = noChildren.cloneNode(); 47 is(clonedNode.hasChildNodes(), false, "Node.cloneNode with false " + 48 "default on a node without children doesn't clone child nodes." ); 49 50 SimpleTest.finish(); 51 } 52 </script> 53 </pre> 54 </body> 55 </html>