tor-browser

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

doc-no-window.html (923B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>Named access on the window object - Document without window</title>
      4 <link rel="author" title="Matthew Phillips" href="mailto:matthew@matthewphillips.info">
      5 <link rel="help" href="https://html.spec.whatwg.org/#named-access-on-the-window-object">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 
      9 <body>
     10 <script>
     11 "use strict";
     12 
     13 test(() => {
     14  const doc = document.implementation.createHTMLDocument();
     15  // Sanity check
     16  assert_equals(doc.defaultView, null);
     17 
     18  const img = doc.createElement("img");
     19  img.setAttribute("id", "foo");
     20  doc.body.appendChild(img);
     21  assert_true(Boolean(img.parentNode));
     22 
     23  img.setAttribute("id", "bar");
     24  assert_equals(img.getAttribute("id"), "bar");
     25 
     26  doc.body.removeChild(img);
     27  assert_false(Boolean(img.parentNode));
     28 }, "A document without a Window must not cause errors");
     29 </script>