Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / invalidation / fullscreen.html
blobc8bb4c89eb2d807ccdbce16288406069bbe056c0
1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script>
3 <style>
4 #full, #ancestor {
5 background-color: red;
8 .t1 #full:-webkit-full-screen,
9 .t2 #ancestor:-webkit-full-screen-ancestor {
10 background-color: green;
12 </style>
13 <div id="testRoot">
14 <div id="ancestor">
15 <div id="full">
16 <div></div>
17 </div>
18 <div></div>
19 </div>
20 <div></div>
21 <div></div>
22 </div>
23 <script>
24 description("Test that descendant invalidation works with fullscreen pseudo classes.");
26 window.jsTestIsAsync = true;
28 var red = "rgb(255, 0, 0)";
29 var green = "rgb(0, 128, 0)";
31 function runTests() {
33 shouldBe("getComputedStyle(full).backgroundColor", "red");
34 testRoot.offsetTop; // force recalc
35 testRoot.className = "t1";
36 if (window.internals)
37 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
38 shouldBe("getComputedStyle(full).backgroundColor", "green");
40 shouldBe("getComputedStyle(ancestor).backgroundColor", "red");
41 testRoot.offsetTop; // force recalc
42 testRoot.className += " t2";
43 if (window.internals)
44 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
45 shouldBe("getComputedStyle(ancestor).backgroundColor", "green");
47 finishJSTest();
50 if (window.testRunner)
51 testRunner.waitUntilDone();
53 document.addEventListener("keypress", function(){
54 document.getElementById("full").webkitRequestFullScreen();
55 });
57 document.addEventListener("webkitfullscreenchange", function(){
58 runTests();
59 });
61 if (window.eventSender)
62 eventSender.keyDown(" ");
63 </script>