f970f5c61b5798c328a9f0b3e50407edaf796d2b
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / 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     var callback;
11     var fullscreenChanged = function(event)
12     {
13         if (callback)
14             callback(event)
15     };
16     waitForEvent(document, "webkitfullscreenchange", fullscreenChanged);
17
18     var span = document.getElementsByTagName("span")[0];
19
20     testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('background-color')", "rgba(0, 0, 0, 0)");
21     testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('background-color')", "rgba(0, 0, 0, 0)");
22     testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('color')", "rgb(0, 0, 0)");
23
24     var documentEnteredFullScreen = function(event) {
25         testExpected("document.webkitCurrentFullScreenElement", document.documentElement);
26         testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('background-color')", "rgba(0, 0, 0, 0)");
27         testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('background-color')", "rgb(0, 255, 0)");
28         testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('color')", "rgb(0, 0, 255)");
29         callback = spanEnteredFullScreen;
30         runWithKeyDown(function(){span.webkitRequestFullScreen()});
31     };
32
33      var spanEnteredFullScreen = function(event) {
34         testExpected("document.webkitCurrentFullScreenElement", span);
35         testExpected("document.defaultView.getComputedStyle(span, null).getPropertyValue('background-color')", "rgb(0, 255, 0)");
36         testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('background-color')", "rgb(255, 0, 0)");
37         testExpected("document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('color')", "rgb(0, 0, 255)");
38         endTest();
39     };
40
41     callback = documentEnteredFullScreen;
42     runWithKeyDown(function(){document.documentElement.webkitRequestFullScreen()});
43 </script>