tor-browser

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

test-010.html (1201B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <title>Shadow DOM Test: A_10_01_02_09</title>
      5 <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
      6 <link rel="help" href="https://dom.spec.whatwg.org/#dom-node-clonenode">
      7 <meta name="assert" content="If context object is a shadow root, throw a NotSupportedError exception.">
      8 <script src="/resources/testharness.js"></script>
      9 <script src="/resources/testharnessreport.js"></script>
     10 <script src="../../../../../html/resources/common.js"></script>
     11 <script src="../../../../resources/shadow-dom-utils.js"></script>
     12 </head>
     13 <body>
     14 <div id="log"></div>
     15 <script>
     16 test(unit(function (ctx) {
     17    var d = newRenderedHTMLDocument(ctx);
     18    var host = d.createElement('div');
     19    d.body.appendChild(host);
     20    var s = host.attachShadow({mode: 'open'});
     21 
     22    try {
     23        s.cloneNode();
     24        assert_true(false, 'Invoking the cloneNode() method on a ShadowRoot instance must always ' +
     25        'throw a NotSupportedError (code 9) exception.');
     26    } catch (e) {
     27        assert_equals(e.code, 9, 'Wrong exception type');
     28        assert_equals(e.name, 'NotSupportedError', 'Wrong exception name');
     29    }
     30 }), 'A_10_01_02_09_T01');
     31 </script>
     32 </body>
     33 </html>