4 <script src=
"full-screen-test.js"></script>
10 one
= document
.getElementById('one');
11 two
= document
.getElementById('two');
14 var fullscreenChanged = function(event
) {
18 waitForEvent(document
, 'webkitfullscreenchange', fullscreenChanged
);
20 var oneEnteredFullscreen = function() {
21 testExpected("document.webkitFullscreenElement.id", "one");
22 callback
= twoEnteredFullscreen
;
23 if (window
.testRunner
)
24 runWithKeyDown(function() { two
.webkitRequestFullscreen(); });
27 var twoEnteredFullscreen = function() {
28 testExpected("document.webkitFullscreenElement.id", "two");
29 callback
= twoExitedFullscreen
;
30 if (window
.testRunner
)
31 document
.webkitExitFullscreen();
34 var twoExitedFullscreen = function() {
35 testExpected("document.webkitFullscreenElement.id", "one");
39 callback
= oneEnteredFullscreen
;
40 if (window
.testRunner
)
41 runWithKeyDown(function() { one
.webkitRequestFullscreen(); });
45 <body onload=
"runTest()">
46 <p>Test for
<a href=
"http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#fullscreen-element-stack">W3C Fullscreen element stack
</a>.
</p>
47 <p>To test manually, click the
"Go full screen" button - the page should enter full screen mode.
</p>
49 <button onclick=
"one.webkitRequestFullscreen()">Go full screen (one)
</button>
52 <button onclick=
"two.webkitRequestFullscreen()">Go full screen (two)
</button>
54 <button onclick=
"document.webkitExitFullscreen()">Exit full screen (two)
</button>