4 https://bugzilla.mozilla.org/show_bug.cgi?id=882541
8 <title>Test for Bug
882541</title>
9 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
11 <script type=
"application/javascript">
13 /** Test for Bug
882541 **/
14 var div = document.createElement(
"div");
15 div.appendChild(document.createElement(
"span"));
19 div2 = div.cloneNode();
20 is(div2.childNodes.length,
0,
"cloneNode() should do a shallow clone");
22 div2 = div.cloneNode(undefined);
23 is(div2.childNodes.length,
0,
"cloneNode(undefined) should do a shallow clone");
25 div2 = div.cloneNode(true);
26 is(div2.childNodes.length,
1,
"cloneNode(true) should do a deep clone");
28 div2 = document.importNode(div);
29 is(div2.childNodes.length,
0,
"importNode(node) should do a deep import");
31 div2 = document.importNode(div, undefined);
32 is(div2.childNodes.length,
0,
"importNode(undefined) should do a shallow import");
34 div2 = document.importNode(div, true);
35 is(div2.childNodes.length,
1,
"importNode(true) should do a deep import");
40 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=882541">Mozilla Bug
882541</a>
42 <div id=
"content" style=
"display: none">