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