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

Unified Diff: LayoutTests/fast/css/invalidation/empty-pseudo.html

Issue 565493002: Use invalidation set for :empty pseudo changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@empty-flag-20140910
Patch Set: Created 6 years, 3 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/empty-pseudo-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/invalidation/empty-pseudo.html
diff --git a/LayoutTests/fast/css/invalidation/empty-pseudo.html b/LayoutTests/fast/css/invalidation/empty-pseudo.html
new file mode 100644
index 0000000000000000000000000000000000000000..da9fbef5642c1bf44e5960a7232e33a162bf8315
--- /dev/null
+++ b/LayoutTests/fast/css/invalidation/empty-pseudo.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<style>
+:empty { background-color: green }
+#empty + div, #not-empty + div { color: pink }
+</style>
+<div id="empty"></div>
+<div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+</div>
+<div id="notEmpty"><div id="child"></div></div>
+<div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+</div>
+<script>
+description("Use descendant invalidation set for :empty pseudo class.")
+
+var transparent = "rgba(0, 0, 0, 0)";
+var green = "rgb(0, 128, 0)";
+
+shouldBe("getComputedStyle(empty, '').backgroundColor", "green");
+
+empty.offsetTop; // force recalc
+empty.appendChild(document.createElement("div"));
+
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
+
+shouldBe("getComputedStyle(empty, '').backgroundColor", "transparent");
+
+shouldBe("getComputedStyle(notEmpty, '').backgroundColor", "transparent");
+
+notEmpty.offsetTop; // force recalc
+notEmpty.removeChild(child);
+
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
+
+shouldBe("getComputedStyle(notEmpty, '').backgroundColor", "green");
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/css/invalidation/empty-pseudo-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698