file_fullscreen-hidden.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=697636
  5. -->
  6. <head>
  7. <title>Test for Bug 697636</title>
  8. <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  9. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  10. </head>
  11. <body>
  12. <iframe id="f" src="data:text/html,<body text=green>1" allowfullscreen></iframe>
  13. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=697636">Mozilla Bug 697636</a>
  14. <p id="display"></p>
  15. <div id="content" style="display: none">
  16. </div>
  17. <pre id="test">
  18. <script type="application/javascript">
  19. /** Test for Bug 697636 **/
  20. var frameWin;
  21. var e1;
  22. function begin()
  23. {
  24. frameWin = document.getElementById("f").contentWindow;
  25. e1 = frameWin.document.documentElement;
  26. frameWin.location = "data:text/html,<body text=blue onload='parent.b2()'>2";
  27. }
  28. function b2()
  29. {
  30. try {
  31. e1.requestFullscreen();
  32. } catch(e) {
  33. opener.ok(false, "[hidden] Should not enter full-screen");
  34. }
  35. setTimeout(done, 0);
  36. }
  37. function done() {
  38. opener.ok(!document.fullscreenElement, "[hidden] Should not have entered full-screen mode in hidden document.");
  39. opener.ok(!e1.ownerDocument.fullscreenElement, "[hidden] Requesting owner should not have entered full-screen mode.");
  40. opener.nextTest();
  41. }
  42. </script>
  43. </pre>
  44. </body>
  45. </html>