file_fullscreen-navigation.html (1247B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=685402 5 --> 6 <head> 7 <title>Test for Bug 685402</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 10 </head> 11 <body style="background-color: gray;"> 12 13 <iframe id="f" srcdoc="<body text=green>1" allowfullscreen></iframe> 14 15 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685402">Mozilla Bug 685402</a> 16 <p id="display"></p> 17 <div id="content" style="display: none"> 18 19 </div> 20 <pre id="test"> 21 <script type="application/javascript"> 22 23 /** Test for Bug 685402 */ 24 25 var frameWin; 26 var e1; 27 var prevEnabled; 28 var prevTrusted; 29 30 function begin() 31 { 32 var f = document.getElementById("f"); 33 frameWin = f.contentWindow; 34 e1 = frameWin.document.body; 35 document.addEventListener("fullscreenchange", function() { 36 opener.ok(document.fullscreenElement, "[navigation] Request should be granted"); 37 f.srcdoc = "<body text=blue onload='parent.b2()'>2"; 38 }, {once: true}); 39 40 e1.requestFullscreen(); 41 } 42 43 function b2() 44 { 45 opener.ok(!document.fullscreenElement, "[navigation] Should have left full-screen due to navigation."); 46 opener.nextTest(); 47 } 48 49 </script> 50 </pre> 51 </body> 52 </html>