file_iframe_sandbox_a_if15.html 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Test for Bug 886262</title>
  6. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  7. </head>
  8. <script>
  9. function doStuff() {
  10. try {
  11. window.parent.parent.parent.ok_wrapper(false, "an object inside a frame or object inside a sandboxed iframe should NOT be same origin with the iframe's parent");
  12. }
  13. catch (e) {
  14. window.parent.parent.parent.postMessage({ok: true, desc: "an object inside a frame or object inside a sandboxed iframe is not same origin with the iframe's parent"}, "*");
  15. }
  16. // Check that sandboxed forms browsing context flag NOT set by attempting to submit a form.
  17. document.getElementById('a_form').submit();
  18. }
  19. </script>
  20. <body onload='doStuff()'>
  21. I'm a &lt;object&gt; inside a &lt;frame&gt; or &lt;object&gt; inside an iframe which is sandboxed with 'allow-scripts allow-forms'
  22. <form method="get" action="file_iframe_sandbox_form_pass.html" id="a_form">
  23. First name: <input type="text" name="firstname">
  24. Last name: <input type="text" name="lastname">
  25. <input type="submit" id="a_button">
  26. </form>
  27. </body>
  28. </html>