Index: LayoutTests/fast/css/invalidation/sub-selector-adjacent-cancellation.html |
diff --git a/LayoutTests/fast/css/invalidation/sub-selector-adjacent-cancellation.html b/LayoutTests/fast/css/invalidation/sub-selector-adjacent-cancellation.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c1c5c0096c681d7ef42890dd4594bc774d09d6de |
--- /dev/null |
+++ b/LayoutTests/fast/css/invalidation/sub-selector-adjacent-cancellation.html |
@@ -0,0 +1,25 @@ |
+<!DOCTYPE html> |
+<script src="../../../resources/js-test.js"></script> |
+<style> |
+:not(.x).a + #b { background-color: green } |
+</style> |
+<div id="a"></div> |
+<div id="b"></div> |
+<script> |
+description("Negated selector should not clear adjacent combinator flag.") |
+ |
+var transparent = "rgba(0, 0, 0, 0)"; |
+var green = "rgb(0, 128, 0)"; |
+ |
+shouldBe("getComputedStyle(b).backgroundColor", "transparent"); |
+ |
+a.offsetTop; // Force recalc. |
+a.className = "a"; |
+ |
+if (window.internals) |
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); |
+else |
+ a.offsetTop; // Force recalc (crbug.com/436064) |
+ |
+shouldBe("getComputedStyle(b).backgroundColor", "green"); |
+</script> |