OLD | NEW |
1 <body> | 1 <body> |
2 <script src="full-screen-test.js"></script> | 2 <script src="full-screen-test.js"></script> |
3 <style> | 3 <style> |
4 :-webkit-full-screen { background: lime; } | 4 :-webkit-full-screen { background: lime; } |
5 :-webkit-full-screen-document { color: blue; } | 5 :-webkit-full-screen-ancestor { color: blue; } |
6 :root:-webkit-full-screen-document:not(:-webkit-full-screen) { background: r
ed; } | 6 :root:-webkit-full-screen-ancestor { background: red; } |
7 </style> | 7 </style> |
8 <span></span> | 8 <span></span> |
9 <script> | 9 <script> |
10 var callback; | 10 var callback; |
11 var fullscreenChanged = function(event) | 11 var fullscreenChanged = function(event) |
12 { | 12 { |
13 if (callback) | 13 if (callback) |
14 callback(event) | 14 callback(event) |
15 }; | 15 }; |
16 waitForEvent(document, "webkitfullscreenchange", fullscreenChanged); | 16 waitForEvent(document, "webkitfullscreenchange", fullscreenChanged); |
17 | 17 |
18 var span = document.getElementsByTagName("span")[0]; | 18 var span = document.getElementsByTagName("span")[0]; |
19 | 19 |
20 testExpected("document.defaultView.getComputedStyle(span, null).getPropertyV
alue('background-color')", "rgba(0, 0, 0, 0)"); | 20 testExpected("document.defaultView.getComputedStyle(span, null).getPropertyV
alue('background-color')", "rgba(0, 0, 0, 0)"); |
21 testExpected("document.defaultView.getComputedStyle(document.documentElement
, 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)"); | 22 testExpected("document.defaultView.getComputedStyle(document.documentElement
, null).getPropertyValue('color')", "rgb(0, 0, 0)"); |
23 | 23 |
24 var documentEnteredFullScreen = function(event) { | 24 var documentEnteredFullScreen = function(event) { |
25 testExpected("document.webkitCurrentFullScreenElement", document.documen
tElement); | 25 testExpected("document.webkitCurrentFullScreenElement", document.documen
tElement); |
26 testExpected("document.defaultView.getComputedStyle(span, null).getPrope
rtyValue('background-color')", "rgba(0, 0, 0, 0)"); | 26 testExpected("document.defaultView.getComputedStyle(span, null).getPrope
rtyValue('background-color')", "rgba(0, 0, 0, 0)"); |
27 testExpected("document.defaultView.getComputedStyle(document.documentEle
ment, null).getPropertyValue('background-color')", "rgb(0, 255, 0)"); | 27 testExpected("document.defaultView.getComputedStyle(document.documentEle
ment, null).getPropertyValue('background-color')", "rgb(0, 255, 0)"); |
28 testExpected("document.defaultView.getComputedStyle(document.documentEle
ment, null).getPropertyValue('color')", "rgb(0, 0, 255)"); | 28 testExpected("document.defaultView.getComputedStyle(document.documentEle
ment, null).getPropertyValue('color')", "rgb(0, 0, 0)"); |
29 callback = spanEnteredFullScreen; | 29 callback = spanEnteredFullScreen; |
30 runWithKeyDown(function(){span.webkitRequestFullScreen()}); | 30 runWithKeyDown(function(){span.webkitRequestFullScreen()}); |
31 }; | 31 }; |
32 | 32 |
33 var spanEnteredFullScreen = function(event) { | 33 var spanEnteredFullScreen = function(event) { |
34 testExpected("document.webkitCurrentFullScreenElement", span); | 34 testExpected("document.webkitCurrentFullScreenElement", span); |
35 testExpected("document.defaultView.getComputedStyle(span, null).getPrope
rtyValue('background-color')", "rgb(0, 255, 0)"); | 35 testExpected("document.defaultView.getComputedStyle(span, null).getPrope
rtyValue('background-color')", "rgb(0, 255, 0)"); |
36 testExpected("document.defaultView.getComputedStyle(document.documentEle
ment, null).getPropertyValue('background-color')", "rgb(255, 0, 0)"); | 36 testExpected("document.defaultView.getComputedStyle(document.documentEle
ment, null).getPropertyValue('background-color')", "rgb(255, 0, 0)"); |
37 testExpected("document.defaultView.getComputedStyle(document.documentEle
ment, null).getPropertyValue('color')", "rgb(0, 0, 255)"); | 37 testExpected("document.defaultView.getComputedStyle(document.documentEle
ment, null).getPropertyValue('color')", "rgb(0, 0, 255)"); |
38 endTest(); | 38 endTest(); |
39 }; | 39 }; |
40 | 40 |
41 callback = documentEnteredFullScreen; | 41 callback = documentEnteredFullScreen; |
42 runWithKeyDown(function(){document.documentElement.webkitRequestFullScreen()
}); | 42 runWithKeyDown(function(){document.documentElement.webkitRequestFullScreen()
}); |
43 </script> | 43 </script> |
OLD | NEW |