Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=882541 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <meta charset="utf-8"> |
michael@0 | 8 | <title>Test for Bug 882541</title> |
michael@0 | 9 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 10 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 11 | <script type="application/javascript"> |
michael@0 | 12 | |
michael@0 | 13 | /** Test for Bug 882541 **/ |
michael@0 | 14 | var div = document.createElement("div"); |
michael@0 | 15 | div.appendChild(document.createElement("span")); |
michael@0 | 16 | |
michael@0 | 17 | var div2; |
michael@0 | 18 | |
michael@0 | 19 | div2 = div.cloneNode(); |
michael@0 | 20 | is(div2.childNodes.length, 0, "cloneNode() should do a shallow clone"); |
michael@0 | 21 | |
michael@0 | 22 | div2 = div.cloneNode(undefined); |
michael@0 | 23 | is(div2.childNodes.length, 0, "cloneNode(undefined) should do a shallow clone"); |
michael@0 | 24 | |
michael@0 | 25 | div2 = div.cloneNode(true); |
michael@0 | 26 | is(div2.childNodes.length, 1, "cloneNode(true) should do a deep clone"); |
michael@0 | 27 | |
michael@0 | 28 | div2 = document.importNode(div); |
michael@0 | 29 | is(div2.childNodes.length, 0, "importNode(node) should do a deep import"); |
michael@0 | 30 | |
michael@0 | 31 | div2 = document.importNode(div, undefined); |
michael@0 | 32 | is(div2.childNodes.length, 0, "importNode(undefined) should do a shallow import"); |
michael@0 | 33 | |
michael@0 | 34 | div2 = document.importNode(div, true); |
michael@0 | 35 | is(div2.childNodes.length, 1, "importNode(true) should do a deep import"); |
michael@0 | 36 | |
michael@0 | 37 | </script> |
michael@0 | 38 | </head> |
michael@0 | 39 | <body> |
michael@0 | 40 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=882541">Mozilla Bug 882541</a> |
michael@0 | 41 | <p id="display"></p> |
michael@0 | 42 | <div id="content" style="display: none"> |
michael@0 | 43 | |
michael@0 | 44 | </div> |
michael@0 | 45 | <pre id="test"> |
michael@0 | 46 | </pre> |
michael@0 | 47 | </body> |
michael@0 | 48 | </html> |