file_fullscreen-esc-exit-inner.html (1207B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=700764 5 6 Verify that an ESC key press in a subdoc of a full-screen doc causes us to 7 exit DOM full-screen mode. 8 9 --> 10 <head> 11 <title>Test for Bug 700764</title> 12 <script src="/tests/SimpleTest/EventUtils.js"></script> 13 <style> 14 body:not(:fullscreen) { 15 background-color: blue; 16 } 17 </style> 18 </head> 19 <body> 20 21 <script type="application/javascript"> 22 23 /** Test for Bug 700764 */ 24 25 function ok(condition, msg) { 26 parent.ok(condition, msg); 27 } 28 29 function is(a, b, msg) { 30 parent.is(a, b, msg); 31 } 32 33 var escKeyReceived = false; 34 var escKeySent = false; 35 36 function keyHandler() { 37 if (escKeyReceived == KeyboardEvent.DOM_VK_ESC) { 38 escKeyReceived = true; 39 } 40 } 41 42 window.addEventListener("keydown", keyHandler, true); 43 window.addEventListener("keyup", keyHandler, true); 44 window.addEventListener("keypress", keyHandler, true); 45 46 function startTest() { 47 ok(!document.fullscreenElement, "Subdoc should not be in full-screen mode"); 48 ok(parent.document.fullscreenElement, "Parent should be in full-screen mode"); 49 escKeySent = true; 50 window.focus(); 51 synthesizeKey("KEY_Escape"); 52 } 53 54 </script> 55 </pre> 56 <p>Inner frame</p> 57 </body> 58 </html>