tor-browser

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

window-named-properties-001.html (1494B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <title>Shadow DOM Test: Window object named properties: Frames</title>
      5 <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
      6 <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
      7 <link rel="author" title="Yuta Kitamura" href="mailto:yutak@google.com">
      8 <link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#upper-boundary-encapsulation">
      9 <meta name="assert" content="Upper-boundary encapsulation: The nodes and named elements are not accessible from Window object named properties.">
     10 <script src="/resources/testharness.js"></script>
     11 <script src="/resources/testharnessreport.js"></script>
     12 <script src="../../../../html/resources/common.js"></script>
     13 </head>
     14 <body>
     15 <div id="log"></div>
     16 <script>
     17 test(function () {
     18    var host = document.createElement('div');
     19    try {
     20        host.style.display = 'none';
     21        document.body.appendChild(host);
     22        var shadowRoot = host.attachShadow({mode: 'open'});
     23        var iframe = document.createElement('iframe');
     24        iframe.style.display = 'none';
     25        iframe.name = 'test-name';
     26        shadowRoot.appendChild(iframe);
     27        assert_false('test-name' in window);
     28    } finally {
     29        if (host.parentNode)
     30            host.parentNode.removeChild(host);
     31    }
     32 },
     33    'An iframe element in a shadow tree should not be accessible from ' +
     34    'window\'s named properties with its "name" attribute value.'
     35 );
     36 </script>
     37 </body>
     38 </html>