tor-browser

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

nested-context.html (1078B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>Named access on the window object - Nested browsing context</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 iframe = document.createElement("iframe");
     15  iframe.setAttribute("name", "foo");
     16  document.body.appendChild(iframe);
     17 
     18  assert_equals(window.foo, iframe.contentWindow);
     19 }, "A named property that matches any element that contains a nested " +
     20  "browsing context, must return the WindowProxy of that context");
     21 
     22 test(() => {
     23  const iframe = document.createElement("iframe");
     24  iframe.setAttribute("id", "bar");
     25  document.body.appendChild(iframe);
     26 
     27  assert_equals(window.bar, iframe);
     28 }, "A named property that matches an element that contains a nested " +
     29  "browsing context must return the element if using id");
     30 </script>