| var runPixelTests = true; |
| // Bail out early if the full screen API is not enabled or is missing: |
| if (Element.prototype.webkitRequestFullScreen == undefined) { |
| logResult(false, "Element.prototype.webkitRequestFullScreen == undefined"); |
| var fullscreenChanged = function(event) |
| waitForEvent(document, 'webkitfullscreenchange', fullscreenChanged); |
| var one = document.getElementById('one'); |
| var two = document.getElementById('two'); |
| var three = document.getElementById('three'); |
| var threeEnteredFullScreen = function(event) { |
| callback = threeExitedFullScreen; |
| testExpected("document.webkitCurrentFullScreenElement", three); |
| var threeExitedFullScreen = function(event) { |
| testExpected("document.webkitCurrentFullScreenElement", null); |
| callback = threeEnteredFullScreen; |
| runWithKeyDown(function(){three.webkitRequestFullScreen()}); |
| var startTest = function() { document.getElementById('three').webkitRequestFullScreen(); }; |
| <script src="full-screen-test.js"></script> |
| border: 4px solid darkgreen; |
| border: 4px solid darkred; |
| border: 4px solid darkblue; |
| 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 completion of the test, a green box should be visible. Click <button onclick="startTest()">go full screen</button> to run the test. |