2 <script src="full-screen-test.js"></script>
4 :-webkit-full-screen { background: lime; }
5 :-webkit-full-screen-document { color: blue; }
6 :root:-webkit-full-screen-document:not(:-webkit-full-screen) { background: red; }
10 // Bail out early if the full screen API is not enabled or is missing:
11 if (Element.prototype.webkitRequestFullScreen == undefined) {
12 logResult(false, "Element.prototype.webkitRequestFullScreen == undefined");
16 var fullscreenChanged = function(event)
21 waitForEvent(document, 'webkitfullscreenchange', fullscreenChanged);
23 var span = document.getElementsByTagName('span')[0];
25 testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('background-color')", "rgba(0, 0, 0, 0)");
26 testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('background-color')", "rgba(0, 0, 0, 0)");
27 testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('color')", "rgb(0, 0, 0)");
29 var spanEnteredFullScreen = function(event) {
30 testExpected("document.webkitCurrentFullScreenElement", span);
31 testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('background-color')", "rgb(0, 255, 0)");
32 testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('background-color')", "rgb(255, 0, 0)");
33 testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('color')", "rgb(0, 0, 255)");
35 callback = documentEnteredFullScreen;
36 runWithKeyDown(function(){document.documentElement.webkitRequestFullScreen()});
39 var documentEnteredFullScreen = function(event) {
40 testExpected("document.webkitCurrentFullScreenElement", document.documentElement);
41 testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('background-color')", "rgba(0, 0, 0, 0)");
42 testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('background-color')", "rgb(0, 255, 0)");
43 testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('color')", "rgb(0, 0, 255)");
47 callback = spanEnteredFullScreen;
48 runWithKeyDown(function(){span.webkitRequestFullScreen()});