4 https://bugzilla.mozilla.org/show_bug.cgi?id=1421568
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();
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);
39 <body onload=
"init()">
40 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1421568">Mozilla Bug
1421568</a>