tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Node-cloneNode-XMLDocument.html (809B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>Cloning of an XMLDocument</title>
      4 <link rel="help" href="https://dom.spec.whatwg.org/#dom-node-clonenode">
      5 <link rel="help" href="https://dom.spec.whatwg.org/#concept-node-clone">
      6 
      7 <!-- This is testing in particular "that implements the same interfaces as node" -->
      8 
      9 <script src="/resources/testharness.js"></script>
     10 <script src="/resources/testharnessreport.js"></script>
     11 
     12 <script>
     13 "use strict";
     14 
     15 test(() => {
     16  const doc = document.implementation.createDocument("namespace", "");
     17 
     18  assert_equals(
     19    doc.constructor, XMLDocument,
     20    "Precondition check: document.implementation.createDocument() creates an XMLDocument"
     21  );
     22 
     23  const clone = doc.cloneNode(true);
     24 
     25  assert_equals(clone.constructor, XMLDocument);
     26 }, "Created with createDocument");
     27 
     28 </script>