OLD | NEW |
1 <head> | 1 <head> |
2 <script> | 2 <script> |
3 var runPixelTests = true; | 3 var runPixelTests = true; |
4 var init = function() { | 4 var init = function() { |
5 // Bail out early if the full screen API is not enabled or is missing: | 5 var callback; |
6 if (Element.prototype.webkitRequestFullScreen == undefined) { | 6 var fullscreenChanged = function(event) |
7 logResult(false, "Element.prototype.webkitRequestFullScreen == undefined
"); | 7 { |
8 endTest(); | 8 if (callback) |
9 } else { | 9 callback(event) |
10 var callback; | 10 }; |
11 var fullscreenChanged = function(event) | 11 document.onwebkitfullscreenchange = fullscreenChanged; |
12 { | |
13 if (callback) | |
14 callback(event) | |
15 }; | |
16 document.onwebkitfullscreenchange = fullscreenChanged; | |
17 | 12 |
18 var one = document.getElementById('one'); | 13 var one = document.getElementById('one'); |
19 var two = document.getElementById('two'); | 14 var two = document.getElementById('two'); |
20 var three = document.getElementById('three'); | 15 var three = document.getElementById('three'); |
21 | 16 |
22 var threeEnteredFullScreen = function(event) { | 17 var threeEnteredFullScreen = function(event) { |
23 if (document.webkitCurrentFullScreenElement == three) { | 18 if (document.webkitCurrentFullScreenElement == three) { |
24 callback = threeExitedFullScreen; | 19 callback = threeExitedFullScreen; |
25 one.removeChild(two); | 20 one.removeChild(two); |
26 } | 21 } |
27 }; | 22 }; |
28 | 23 |
29 var threeExitedFullScreen = function(event) { | 24 var threeExitedFullScreen = function(event) { |
30 if (document.webkitCurrentFullScreenElement == null) { | 25 if (document.webkitCurrentFullScreenElement == null) { |
31 callback = null; | 26 callback = null; |
32 endTest(); | 27 endTest(); |
33 } | 28 } |
34 }; | 29 }; |
35 | 30 |
36 callback = threeEnteredFullScreen; | 31 callback = threeEnteredFullScreen; |
37 | 32 |
38 function goFullScreen() { | 33 function goFullScreen() { |
39 document.getElementById('three').webkitRequestFullScreen(); | 34 document.getElementById('three').webkitRequestFullScreen(); |
40 } | |
41 runWithKeyDown(goFullScreen); | |
42 } | 35 } |
| 36 runWithKeyDown(goFullScreen); |
43 }; | 37 }; |
44 </script> | 38 </script> |
45 <script src="full-screen-test.js"></script> | 39 <script src="full-screen-test.js"></script> |
46 <style> | 40 <style> |
47 #one { | 41 #one { |
48 border: 4px solid darkgreen; | 42 border: 4px solid darkgreen; |
49 background-color: green; | 43 background-color: green; |
50 width: 600px; | 44 width: 600px; |
51 height: 400px; | 45 height: 400px; |
52 padding: 4px; | 46 padding: 4px; |
(...skipping 17 matching lines...) Expand all Loading... |
70 <body onload="init()"> | 64 <body onload="init()"> |
71 | 65 |
72 This tests that, if the ancestor of the current full-screen element is removed,
full screen mode will exit, and the document will render normally. At the compl
etion of the test, a green box should be visible. Click <button onclick="goFullS
creen()">go full screen</button> to run the test. | 66 This tests that, if the ancestor of the current full-screen element is removed,
full screen mode will exit, and the document will render normally. At the compl
etion of the test, a green box should be visible. Click <button onclick="goFullS
creen()">go full screen</button> to run the test. |
73 | 67 |
74 <div id="one"> | 68 <div id="one"> |
75 <div id="two"> | 69 <div id="two"> |
76 <div id="three"></div> | 70 <div id="three"></div> |
77 </div> | 71 </div> |
78 </div> | 72 </div> |
79 </body> | 73 </body> |
OLD | NEW |