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

Unified Diff: LayoutTests/fast/css/invalidation/invalidation-set-not.html

Issue 462593002: Support invalidation sets for negated selectors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@tmp-upstream
Patch Set: Rebased Created 6 years, 4 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-host-pseudo.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/invalidation/invalidation-set-not.html
diff --git a/LayoutTests/fast/css/invalidation/invalidation-set-not.html b/LayoutTests/fast/css/invalidation/invalidation-set-not.html
new file mode 100644
index 0000000000000000000000000000000000000000..b03dcd0105825b7764df1b13c19b839415c8d1f5
--- /dev/null
+++ b/LayoutTests/fast/css/invalidation/invalidation-set-not.html
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<style>
+#p1 :not(.t1),
+#p2 :not(.t2) #r2,
+#p3 :not(.t3) :not(.nomatch),
+#p4 .t4 :not(.nomatch),
+#p5 :-webkit-any(:not(.t5), #dummy) #r5,
+#p6 .t6 #r6:not(.dummy) { background-color: rgb(0, 128, 0); }
+</style>
+<div id="p1">
+ <div id="t1" class="t1">
+ <div></div>
+ <div></div>
+ </div>
+</div>
+<div id="p2">
+ <div id="t2" class="t2">
+ <div></div>
+ <div id="r2"></div>
+ </div>
+</div>
+<div id="p3">
+ <div id="t3" class="t3">
+ <div></div>
+ <div id="r3"></div>
+ </div>
+</div>
+<div id="p4">
+ <div id="t4">
+ <div></div>
+ <div id="r4"></div>
+ </div>
+</div>
+<div id="p5">
+ <div id="t5" class="t5">
+ <div></div>
+ <div id="r5"></div>
+ </div>
+</div>
+<div id="p6">
+ <div id="t6">
+ <div></div>
+ <div id="r6"></div>
+ </div>
+</div>
+<script>
+document.body.offsetTop;
+
+test(function() {
+ assert_true(!!window.internals, "This test only works with internals exposed present");
+ assert_equals(getComputedStyle(t1).backgroundColor, "rgba(0, 0, 0, 0)", "Background color should initially be transparent");
+
+ t1.className = "";
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Single element style recalc");
+ assert_equals(getComputedStyle(t1).backgroundColor, "rgb(0, 128, 0)", "Background color is green after class change");
+}, "Negated class without combinators");
+
+test(function() {
+ assert_true(!!window.internals, "This test only works with internals exposed present");
+ assert_equals(getComputedStyle(r2).backgroundColor, "rgba(0, 0, 0, 0)", "Background color should initially be transparent");
+
+ t2.className = "";
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Recalc changed element and #r2");
+ assert_equals(getComputedStyle(r2).backgroundColor, "rgb(0, 128, 0)", "Background color is green after class change");
+}, "Id descendant of negated class");
+
+test(function() {
+ assert_true(!!window.internals, "This test only works with internals exposed present");
+ assert_equals(getComputedStyle(r3).backgroundColor, "rgba(0, 0, 0, 0)", "Background color should initially be transparent");
+
+ t3.className = "";
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subtree style recalc");
+ assert_equals(getComputedStyle(r3).backgroundColor, "rgb(0, 128, 0)", "Background color is green after class change");
+}, "Negated class descendant of negated class");
+
+test(function() {
+ assert_true(!!window.internals, "This test only works with internals exposed present");
+ assert_equals(getComputedStyle(r4).backgroundColor, "rgba(0, 0, 0, 0)", "Background color should initially be transparent");
+
+ t4.className = "t4";
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subtree style recalc");
+ assert_equals(getComputedStyle(r4).backgroundColor, "rgb(0, 128, 0)", "Background color is green after class change");
+}, "Negated class descendant of class");
+
+test(function() {
+ assert_true(!!window.internals, "This test only works with internals exposed present");
+ assert_equals(getComputedStyle(r5).backgroundColor, "rgba(0, 0, 0, 0)", "Background color should initially be transparent");
+
+ t5.className = "";
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Recalc changed element and #r5");
+ assert_equals(getComputedStyle(r5).backgroundColor, "rgb(0, 128, 0)", "Background color is green after class change");
+}, "Id descendant of negated class in :-webkit-any");
+
+test(function() {
+ assert_true(!!window.internals, "This test only works with internals exposed present");
+ assert_equals(getComputedStyle(r6).backgroundColor, "rgba(0, 0, 0, 0)", "Background color should initially be transparent");
+
+ t6.className = "t6";
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Recalc changed element and #r6");
+ assert_equals(getComputedStyle(r6).backgroundColor, "rgb(0, 128, 0)", "Background color is green after class change");
+}, "Negated class with id descendant of class");
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/css/invalidation/targeted-class-host-pseudo.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698