summaryrefslogtreecommitdiffstats
path: root/dom/bindings/test/test_cloneAndImportNode.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /dom/bindings/test/test_cloneAndImportNode.html
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--dom/bindings/test/test_cloneAndImportNode.html48
1 files changed, 48 insertions, 0 deletions
diff --git a/dom/bindings/test/test_cloneAndImportNode.html b/dom/bindings/test/test_cloneAndImportNode.html
new file mode 100644
index 0000000000..4acfec82cd
--- /dev/null
+++ b/dom/bindings/test/test_cloneAndImportNode.html
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=882541
+-->
+<head>
+ <meta charset="utf-8">
+ <title>Test for Bug 882541</title>
+ <script src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+ <script type="application/javascript">
+
+ /** Test for Bug 882541 **/
+ var div = document.createElement("div");
+ div.appendChild(document.createElement("span"));
+
+ var div2;
+
+ div2 = div.cloneNode();
+ is(div2.childNodes.length, 0, "cloneNode() should do a shallow clone");
+
+ div2 = div.cloneNode(undefined);
+ is(div2.childNodes.length, 0, "cloneNode(undefined) should do a shallow clone");
+
+ div2 = div.cloneNode(true);
+ is(div2.childNodes.length, 1, "cloneNode(true) should do a deep clone");
+
+ div2 = document.importNode(div);
+ is(div2.childNodes.length, 0, "importNode(node) should do a deep import");
+
+ div2 = document.importNode(div, undefined);
+ is(div2.childNodes.length, 0, "importNode(undefined) should do a shallow import");
+
+ div2 = document.importNode(div, true);
+ is(div2.childNodes.length, 1, "importNode(true) should do a deep import");
+
+ </script>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=882541">Mozilla Bug 882541</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+
+</div>
+<pre id="test">
+</pre>
+</body>
+</html>