dom/bindings/test/test_cloneAndImportNode.html

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=882541
     5 -->
     6 <head>
     7   <meta charset="utf-8">
     8   <title>Test for Bug 882541</title>
     9   <script type="application/javascript" 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"));
    17   var div2;
    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");
    37   </script>
    38 </head>
    39 <body>
    40 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=882541">Mozilla Bug 882541</a>
    41 <p id="display"></p>
    42 <div id="content" style="display: none">
    44 </div>
    45 <pre id="test">
    46 </pre>
    47 </body>
    48 </html>

mercurial