REGRESSION: ASSERTION FAILED: obj->isRenderInline() || obj == this, Bad cast in WebCo...
[WebKit-https.git] / LayoutTests / fullscreen / full-screen-css.html
1 <body>
2 <script src="full-screen-test.js"></script>
3 <style>
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; }
7 </style>
8 <span></span>
9 <script>
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");
13         endTest();
14     } else {
15         var callback;
16         var fullscreenChanged = function(event)
17         {
18             if (callback)
19                 callback(event)
20         };
21         waitForEvent(document, 'webkitfullscreenchange', fullscreenChanged);
22
23         var span = document.getElementsByTagName('span')[0];
24     
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)");
28     
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)");
34         
35             callback = documentEnteredFullScreen;
36             runWithKeyDown(function(){document.documentElement.webkitRequestFullScreen()});
37         };
38     
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)");
44             endTest();
45         };
46     
47         callback = spanEnteredFullScreen;
48         runWithKeyDown(function(){span.webkitRequestFullScreen()});
49     }
50 </script>