blob: ac7ff0d8ce3ff4a3da55f9977bdb8e6f8810c5b6 [file] [log] [blame]
[email protected]d923f992011-06-11 03:36:151<head>
2<script>
3var runPixelTests = true;
4var init = function() {
[email protected]41080742014-08-14 14:26:115 var callback;
6 var fullscreenChanged = function(event)
7 {
8 if (callback)
9 callback(event)
10 };
11 document.onwebkitfullscreenchange = fullscreenChanged;
[email protected]d923f992011-06-11 03:36:1512
[email protected]41080742014-08-14 14:26:1113 var one = document.getElementById('one');
14 var two = document.getElementById('two');
15 var three = document.getElementById('three');
[email protected]d923f992011-06-11 03:36:1516
[email protected]41080742014-08-14 14:26:1117 var threeEnteredFullScreen = function(event) {
18 if (document.webkitCurrentFullScreenElement == three) {
19 callback = threeExitedFullScreen;
20 one.removeChild(two);
[email protected]a72aca52014-08-12 06:46:3421 }
[email protected]41080742014-08-14 14:26:1122 };
23
24 var threeExitedFullScreen = function(event) {
25 if (document.webkitCurrentFullScreenElement == null) {
26 callback = null;
27 endTest();
28 }
29 };
30
31 callback = threeEnteredFullScreen;
32
33 function goFullScreen() {
34 document.getElementById('three').webkitRequestFullScreen();
[email protected]d923f992011-06-11 03:36:1535 }
[email protected]41080742014-08-14 14:26:1136 runWithKeyDown(goFullScreen);
[email protected]d923f992011-06-11 03:36:1537};
[email protected]d923f992011-06-11 03:36:1538</script>
39<script src="full-screen-test.js"></script>
40<style>
41#one {
42 border: 4px solid darkgreen;
43 background-color: green;
44 width: 600px;
45 height: 400px;
46 padding: 4px;
47}
48
49#two {
50 border: 4px solid darkred;
51 background-color: red;
52 padding: 4px;
53 height: 384px;
54}
55
56#three {
57 border: 4px solid darkblue;
58 background-color: blue;
59 padding: 4px;
60 height: 368px;
61}
[email protected]12618d222015-01-08 14:59:3462:-webkit-full-screen-ancestor {
63 background-color: yellow;
64}
[email protected]d923f992011-06-11 03:36:1565</style>
66</head>
67<body onload="init()">
[email protected]a72aca52014-08-12 06:46:3468
69This 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 completion of the test, a green box should be visible. Click <button onclick="goFullScreen()">go full screen</button> to run the test.
[email protected]d923f992011-06-11 03:36:1570
71<div id="one">
72 <div id="two">
73 <div id="three"></div>
74 </div>
75</div>
[email protected]a72aca52014-08-12 06:46:3476</body>