Index: LayoutTests/fast/css/invalidation/invalidation-set-with-adjacent-combinators.html |
diff --git a/LayoutTests/fast/css/invalidation/invalidation-set-with-adjacent-combinators.html b/LayoutTests/fast/css/invalidation/invalidation-set-with-adjacent-combinators.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..da9573db647036ad3ee63a40858e0d01a09d1c14 |
--- /dev/null |
+++ b/LayoutTests/fast/css/invalidation/invalidation-set-with-adjacent-combinators.html |
@@ -0,0 +1,75 @@ |
+<!DOCTYPE html> |
+<script src="../../../resources/js-test.js"></script> |
+<style> |
+.c5 > .c4 ~ .c3 .c2 + .c1 { background-color: green } |
+</style> |
+<!-- |
+Expected sets |
+ |
+.c1 { } |
+.c2 { subtree } |
+.c3 { c1 } |
+.c4 { subtree } |
+.c5 { c1 } |
+ |
+--> |
+<div id="i5"> |
+ <div id="i4"></div> |
+ <div></div> |
+ <div></div> |
+ <div></div> |
+ <div id="i3"> |
+ <div> |
+ <div id="i2"></div> |
+ <div id="i1"> |
+ <div>This text should have a green background.</div> |
+ <span></span> |
+ <span></span> |
+ </div> |
+ </div> |
+ </div> |
+</div> |
+<script> |
+description("Check that targeted class invalidation works with when adjacent combinators are present."); |
+ |
+var transparent = "rgba(0, 0, 0, 0)"; |
+var green = "rgb(0, 128, 0)"; |
+ |
+var i1 = document.getElementById("i1"); |
+var i2 = document.getElementById("i2"); |
+var i3 = document.getElementById("i3"); |
+var i4 = document.getElementById("i4"); |
+var i5 = document.getElementById("i5"); |
+ |
+shouldBe("getComputedStyle(i1, null).backgroundColor", "transparent"); |
+ |
+document.body.offsetTop; // Force style recalc. |
+i1.className = "c1"; |
+if (window.internals) |
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); |
+ |
+document.body.offsetTop; // Force style recalc. |
+i2.className = "c2"; |
+if (window.internals) |
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); |
+ |
+document.body.offsetTop; // Force style recalc. |
+i3.className = "c3"; |
+if (window.internals) |
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); |
+ |
+document.body.offsetTop; // Force style recalc. |
+i4.className = "c4"; |
+if (window.internals) |
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); |
+ |
+shouldBe("getComputedStyle(i1, null).backgroundColor", "transparent"); |
+ |
+document.body.offsetLeft; // force style recalc. |
+i5.className = "c5"; |
+if (window.internals) |
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); |
+ |
+shouldBe("getComputedStyle(i1, null).backgroundColor", "green"); |
+ |
+</script> |