blob: 716306de3aa3bf67cf5d88e2357e574938af1e59 [file] [log] [blame]
<!DOCTYPE html>
function enterFullScreen() {
var element = document.getElementById("fullscreen");
element.innerText = "Press the space bar.";
var consoleDiv = document.getElementById("console");
consoleDiv.innerHTML = "<span style='color:red'>FAIL</span>";
document.addEventListener("keydown", function(event) {
consoleDiv.innerHTML = "<span style='color:green'>PASS</span>";
}, true);
element.addEventListener("webkitfullscreenchange", function(event) {
if (!document.webkitIsFullScreen)
element.innerText = "";
}, false);
<p>This test checks that keyboard events are received by an element in full screen mode. To run the test, press the 'Enter Full Screen' button then press the space bar. The test passes if the element exists full screen and you see the word 'PASS' below.</p>
<button onclick="enterFullScreen()">Enter Full Screen</button>
<div id="fullscreen"></div>
<div id="console"></div>