OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>Mixed prefixed and unprefixed requests</title> |
| 3 <script src="full-screen-test.js"></script> |
| 4 <div><span></span></div> |
| 5 <script> |
| 6 var callback; |
| 7 function fullscreenChanged(event) |
| 8 { |
| 9 if (callback) |
| 10 callback(event) |
| 11 } |
| 12 waitForEvent(document, "fullscreenchange", fullscreenChanged); |
| 13 waitForEvent(document, "webkitfullscreenchange", fullscreenChanged); |
| 14 |
| 15 var div = document.querySelector("div"); |
| 16 var span = document.querySelector("span"); |
| 17 |
| 18 function divEnteredFullscreen() |
| 19 { |
| 20 testExpected("document.fullscreenElement", div); |
| 21 testExpected("document.webkitFullscreenElement", div); |
| 22 callback = spanEnteredFullscreen; |
| 23 runWithKeyDown(function() { span.requestFullscreen(); }); |
| 24 } |
| 25 |
| 26 function spanEnteredFullscreen() |
| 27 { |
| 28 testExpected("document.fullscreenElement", span); |
| 29 testExpected("document.webkitFullscreenElement", span); |
| 30 callback = spanExitedFullscreen; |
| 31 document.webkitExitFullscreen(); |
| 32 } |
| 33 |
| 34 function spanExitedFullscreen() |
| 35 { |
| 36 testExpected("document.fullscreenElement", div); |
| 37 testExpected("document.webkitFullscreenElement", div); |
| 38 callback = divExitedFullscreen; |
| 39 document.webkitExitFullscreen(); |
| 40 } |
| 41 |
| 42 function divExitedFullscreen() |
| 43 { |
| 44 testExpected("document.fullscreenElement", null); |
| 45 testExpected("document.webkitFullscreenElement", null); |
| 46 endTest(); |
| 47 } |
| 48 |
| 49 callback = divEnteredFullscreen; |
| 50 runWithKeyDown(function() { div.webkitRequestFullscreen(); }); |
| 51 </script> |
OLD | NEW |