OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 | 2 |
3 <div> | 3 <div> |
4 <span>1</span> | 4 <span>1</span> |
5 <span id='c2'>2</span> | 5 <span id='c2'>2</span> |
6 </div> | 6 </div> |
7 | 7 |
8 <script> | 8 <script> |
9 if ('webkitRequestFullScreen' in Element.prototype) { | 9 if (window.testRunner) |
10 if (window.testRunner) | 10 testRunner.waitUntilDone(); |
11 testRunner.waitUntilDone(); | |
12 | 11 |
13 var callback; | 12 var callback; |
14 var fullscreenChanged = function(event) | 13 var fullscreenChanged = function(event) |
15 { | 14 { |
16 if (callback) | 15 if (callback) |
17 callback(event) | 16 callback(event) |
18 }; | 17 }; |
19 document.addEventListener('webkitfullscreenchange', fullscreenChanged); | 18 document.addEventListener('webkitfullscreenchange', fullscreenChanged); |
20 | 19 |
21 document.body.offsetTop; | 20 document.body.offsetTop; |
22 var span = document.getElementById('c2'); | 21 var span = document.getElementById('c2'); |
23 var div = span.parentNode; | 22 var div = span.parentNode; |
24 | 23 |
25 var spanEnteredFullScreen = function(event) { | 24 var spanEnteredFullScreen = function(event) { |
26 setTimeout(function () { | 25 setTimeout(function () { |
27 span.appendChild(document.createElement('div')); | 26 span.appendChild(document.createElement('div')); |
28 callback = function() { | 27 callback = function() { |
29 if (window.testRunner) | 28 if (window.testRunner) |
30 testRunner.notifyDone(); | 29 testRunner.notifyDone(); |
31 } | 30 } |
32 document.webkitCancelFullScreen(); | 31 document.webkitCancelFullScreen(); |
33 }, 0); | 32 }, 0); |
34 }; | 33 }; |
35 | 34 |
36 callback = spanEnteredFullScreen; | 35 callback = spanEnteredFullScreen; |
37 | 36 |
38 document.addEventListener('keydown', function () { | 37 document.addEventListener('keydown', function () { |
39 span.webkitRequestFullScreen(); | 38 span.webkitRequestFullScreen(); |
40 }); | 39 }); |
41 if (window.eventSender) | 40 if (window.eventSender) |
42 eventSender.keyDown('a'); | 41 eventSender.keyDown('a'); |
43 } | |
44 </script> | 42 </script> |
OLD | NEW |