OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/js-test.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
3 <style> | 3 <style> |
4 #full, #ancestor, #doc { | 4 #full, #ancestor { |
5 background-color: red; | 5 background-color: red; |
6 } | 6 } |
7 | 7 |
8 .t1 #full:-webkit-full-screen, | 8 .t1 #full:-webkit-full-screen, |
9 .t2 #ancestor:-webkit-full-screen-ancestor, | 9 .t2 #ancestor:-webkit-full-screen-ancestor { |
10 .t3 #doc:-webkit-full-screen-document { | |
11 background-color: green; | 10 background-color: green; |
12 } | 11 } |
13 </style> | 12 </style> |
14 <div id="testRoot"> | 13 <div id="testRoot"> |
15 <div id="ancestor"> | 14 <div id="ancestor"> |
16 <div id="full"> | 15 <div id="full"> |
17 <div></div> | 16 <div></div> |
18 </div> | 17 </div> |
19 <div id="doc"> | |
20 <div></div> | |
21 </div> | |
22 <div></div> | 18 <div></div> |
23 </div> | 19 </div> |
24 <div></div> | 20 <div></div> |
25 <div></div> | 21 <div></div> |
26 </div> | 22 </div> |
27 <script> | 23 <script> |
28 description("Test that descendant invalidation works with fullscreen pseudo clas
ses."); | 24 description("Test that descendant invalidation works with fullscreen pseudo clas
ses."); |
29 | 25 |
30 window.jsTestIsAsync = true; | 26 window.jsTestIsAsync = true; |
31 | 27 |
32 var red = "rgb(255, 0, 0)"; | 28 var red = "rgb(255, 0, 0)"; |
33 var green = "rgb(0, 128, 0)"; | 29 var green = "rgb(0, 128, 0)"; |
34 | 30 |
35 function runTests() { | 31 function runTests() { |
36 | 32 |
37 shouldBe("getComputedStyle(full).backgroundColor", "red"); | 33 shouldBe("getComputedStyle(full).backgroundColor", "red"); |
38 testRoot.offsetTop; // force recalc | 34 testRoot.offsetTop; // force recalc |
39 testRoot.className = "t1"; | 35 testRoot.className = "t1"; |
40 if (window.internals) | 36 if (window.internals) |
41 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); | 37 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); |
42 shouldBe("getComputedStyle(full).backgroundColor", "green"); | 38 shouldBe("getComputedStyle(full).backgroundColor", "green"); |
43 | 39 |
44 shouldBe("getComputedStyle(ancestor).backgroundColor", "red"); | 40 shouldBe("getComputedStyle(ancestor).backgroundColor", "red"); |
45 testRoot.offsetTop; // force recalc | 41 testRoot.offsetTop; // force recalc |
46 testRoot.className += " t2"; | 42 testRoot.className += " t2"; |
47 if (window.internals) | 43 if (window.internals) |
48 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); | 44 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); |
49 shouldBe("getComputedStyle(ancestor).backgroundColor", "green"); | 45 shouldBe("getComputedStyle(ancestor).backgroundColor", "green"); |
50 | 46 |
51 shouldBe("getComputedStyle(doc).backgroundColor", "red"); | |
52 testRoot.offsetTop; // force recalc | |
53 testRoot.className += " t3"; | |
54 if (window.internals) | |
55 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); | |
56 shouldBe("getComputedStyle(doc).backgroundColor", "green"); | |
57 | |
58 finishJSTest(); | 47 finishJSTest(); |
59 } | 48 } |
60 | 49 |
61 if (window.testRunner) | 50 if (window.testRunner) |
62 testRunner.waitUntilDone(); | 51 testRunner.waitUntilDone(); |
63 | 52 |
64 document.addEventListener("keypress", function(){ | 53 document.addEventListener("keypress", function(){ |
65 document.getElementById("full").webkitRequestFullScreen(); | 54 document.getElementById("full").webkitRequestFullScreen(); |
66 }); | 55 }); |
67 | 56 |
68 document.addEventListener("webkitfullscreenchange", function(){ | 57 document.addEventListener("webkitfullscreenchange", function(){ |
69 runTests(); | 58 runTests(); |
70 }); | 59 }); |
71 | 60 |
72 if (window.eventSender) | 61 if (window.eventSender) |
73 eventSender.keyDown(" "); | 62 eventSender.keyDown(" "); |
74 </script> | 63 </script> |
OLD | NEW |