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

Unified Diff: LayoutTests/fast/css/invalidation/targeted-class-any-pseudo.html

Issue 210973004: Support invalidation sets for :-webkit-any selectors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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/targeted-class-any-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/targeted-class-any-pseudo.html
diff --git a/LayoutTests/fast/css/invalidation/targeted-class-any-pseudo.html b/LayoutTests/fast/css/invalidation/targeted-class-any-pseudo.html
new file mode 100644
index 0000000000000000000000000000000000000000..d55d2a1362f3e1099ca37861d1a9d06f6ce0ffdf
--- /dev/null
+++ b/LayoutTests/fast/css/invalidation/targeted-class-any-pseudo.html
@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<style>
+:-webkit-any(.a1) { background-color: green }
+.a2 :-webkit-any(.b2) { background-color: green }
+.a3 :-webkit-any(.b3, .c3) { background-color: green }
+.a4 :-webkit-any(:not(.b4), .c4) { background-color: green }
+</style>
+<div id="t1">
+ <span></span>
+ <span></span>
+ <span></span>
+ <span></span>
+</div>
+<div id="t2">
+ <span></span>
+ <span></span>
+ <span></span>
+ <span class="b2"></span>
+</div>
+<div id="t3">
+ <span></span>
+ <span></span>
+ <span class="b3"></span>
+ <span class="c3"></span>
+</div>
+<div id="t4">
+ <span></span>
+ <span class="b4"></span>
+ <span class="b4"></span>
+ <span class="c4"></span>
+</div>
+<script>
+description("Check that targeted class invalidation works with :-webkit-any selectors.");
+
+var transparent = "rgba(0, 0, 0, 0)";
+var green = "rgb(0, 128, 0)";
+
+var t1 = document.getElementById("t1");
+var b2 = document.querySelector("#t2 .b2");
+var b3 = document.querySelector("#t3 .b3");
+var c3 = document.querySelector("#t3 .c3");
+var spans4 = document.querySelectorAll("#t4 span");
+
+shouldBe("getComputedStyle(t1, null).backgroundColor", "transparent");
+shouldBe("getComputedStyle(b2, null).backgroundColor", "transparent");
+shouldBe("getComputedStyle(b3, null).backgroundColor", "transparent");
+shouldBe("getComputedStyle(c3, null).backgroundColor", "transparent");
+
+for (var i=0; i<4; i++)
+ shouldBe("getComputedStyle(spans4[i], null).backgroundColor", "transparent");
+
+document.body.offsetLeft; // force style recalc.
+
+t1.className = "a1";
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
+shouldBe("getComputedStyle(t1, null).backgroundColor", "green");
+
+document.body.offsetLeft; // force style recalc.
+
+document.getElementById("t2").className = "a2";
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
+shouldBe("getComputedStyle(b2, null).backgroundColor", "green");
+
+document.body.offsetLeft; // force style recalc.
+
+document.getElementById("t3").className = "a3";
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "3");
+shouldBe("getComputedStyle(b3, null).backgroundColor", "green");
+shouldBe("getComputedStyle(c3, null).backgroundColor", "green");
+
+document.body.offsetLeft; // force style recalc.
+
+document.getElementById("t4").className = "a4";
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "5");
+shouldBe("getComputedStyle(spans4[0], null).backgroundColor", "green");
+shouldBe("getComputedStyle(spans4[1], null).backgroundColor", "transparent");
+shouldBe("getComputedStyle(spans4[2], null).backgroundColor", "transparent");
+shouldBe("getComputedStyle(spans4[3], null).backgroundColor", "green");
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/css/invalidation/targeted-class-any-pseudo-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698