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