Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Unified Diff: LayoutTests/fast/css/invalidation/fullscreen.html

Issue 663023003: Avoid subtree style recalc for fullscreen pseudos. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/css/invalidation/fullscreen-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/invalidation/fullscreen.html
diff --git a/LayoutTests/fast/css/invalidation/fullscreen.html b/LayoutTests/fast/css/invalidation/fullscreen.html
new file mode 100644
index 0000000000000000000000000000000000000000..bae172654a722be05c7dbad2c4f0b23806cee89a
--- /dev/null
+++ b/LayoutTests/fast/css/invalidation/fullscreen.html
@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<style>
+#full, #ancestor, #doc {
+ background-color: red;
+}
+
+.t1 #full:-webkit-full-screen,
+.t2 #ancestor:-webkit-full-screen-ancestor,
+.t3 #doc:-webkit-full-screen-document {
+ background-color: green;
+}
+</style>
+<div id="testRoot">
+ <div id="ancestor">
+ <div id="full">
+ <div></div>
+ </div>
+ <div id="doc">
+ <div></div>
+ </div>
+ <div></div>
+ </div>
+ <div></div>
+ <div></div>
+</div>
+<script>
+description("Test that descendant invalidation works with fullscreen pseudo classes.");
+
+window.jsTestIsAsync = true;
+
+var red = "rgb(255, 0, 0)";
+var green = "rgb(0, 128, 0)";
+
+function runTests() {
+
+ shouldBe("getComputedStyle(full).backgroundColor", "red");
+ testRoot.offsetTop; // force recalc
+ testRoot.className = "t1";
+ if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
+ shouldBe("getComputedStyle(full).backgroundColor", "green");
+
+ shouldBe("getComputedStyle(ancestor).backgroundColor", "red");
+ testRoot.offsetTop; // force recalc
+ testRoot.className += " t2";
+ if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
+ shouldBe("getComputedStyle(ancestor).backgroundColor", "green");
+
+ shouldBe("getComputedStyle(doc).backgroundColor", "red");
+ testRoot.offsetTop; // force recalc
+ testRoot.className += " t3";
+ if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
+ shouldBe("getComputedStyle(doc).backgroundColor", "green");
+
+ finishJSTest();
+}
+
+if (window.testRunner)
+ testRunner.waitUntilDone();
+
+document.addEventListener("keypress", function(){
+ document.getElementById("full").webkitRequestFullScreen();
+});
+
+document.addEventListener("webkitfullscreenchange", function(){
+ runTests();
+});
+
+if (window.eventSender)
+ eventSender.keyDown(" ");
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/css/invalidation/fullscreen-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698