4 https://bugzilla.mozilla.org/show_bug.cgi?id=797909
8 <title>Test for Bug
797909</title>
9 <script type=
"application/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
12 <body onload=
"runTest()">
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=797909">Mozilla Bug
797909</a>
15 <div id=
"content" style=
"display: none">
19 <script type=
"application/javascript">
20 /** Test for Bug
797909 **/
22 SimpleTest.waitForExplicitFinish();
25 iframe = document.getElementById(
"ifr");
27 var iframeDoc = iframe.contentWindow.document;
28 ok(false,
"Should have thrown an exception");
30 ok(true,
"Got an exception");
33 iframe = document.createElement(
"iframe");
34 // set sandbox attribute
35 iframe.sandbox =
"allow-scripts";
36 // and then insert into the doc
37 document.body.appendChild(iframe);
40 var iframeDoc = iframe.contentWindow.document;
41 ok(false,
"Should have thrown an exception");
43 ok(true,
"Got an exception");
46 iframe = document.createElement(
"iframe");
47 // set sandbox attribute
48 iframe.sandbox =
"allow-same-origin";
49 // and then insert into the doc
50 document.body.appendChild(iframe);
53 var iframeDoc = iframe.contentWindow.document;
54 ok(true,
"Shouldn't have thrown an exception");
56 ok(false,
"Got an unexpected exception");
64 <iframe id=
"ifr" sandbox =
"allow-scripts"></iframe>