Bug 1686668 [wpt PR 27185] - Update wpt metadata, a=testonly
[gecko.git] / dom / base / test / test_bug1421568.html
blobf4864c81c17ebe573961563a6ca975740eccfbe4
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=1421568
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for Bug 1421568</title>
9 <script src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 <script type="application/javascript"><!--
13 /** Test for Bug 1421568 **/
15 SimpleTest.waitForExplicitFinish();
17 function init() {
18 document.getElementById("content").innerHTML =
19 "<iframe src='about:blank' onload='test(this)'></iframe>";
22 function test(iframe) {
23 var d = iframe.contentDocument;
24 d.body.innerHTML = "<div>";
25 var div = d.body.firstChild;
26 var sr = div.attachShadow({mode: "closed"});
27 is(sr.mode, "closed", "Shadow root should be closed.");
28 is(div.shadowRoot, null, "Closed shadow root shouldn't be exposed.");
29 is(div.openOrClosedShadowRoot, undefined,
30 "openOrClosedShadowRoot should be exposed to the privileged scripts only.");
31 ok("openOrClosedShadowRoot" in SpecialPowers.wrap(div),
32 "Should have openOrClosedShadowRoot in privileged wrapper.")
33 is(SpecialPowers.unwrap(SpecialPowers.wrap(div).openOrClosedShadowRoot), sr);
34 SimpleTest.finish();
37 //--></script>
38 </head>
39 <body onload="init()">
40 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1421568">Mozilla Bug 1421568</a>
41 <p id="display"></p>
42 <div id="content">
44 </div>
45 <pre id="test">
46 </pre>
47 </body>
48 </html>