Index: LayoutTests/fast/css/pseudo-not-empty-adjacent-dynamic.html |
diff --git a/LayoutTests/fast/css/pseudo-not-empty-adjacent-dynamic.html b/LayoutTests/fast/css/pseudo-not-empty-adjacent-dynamic.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b6671150c0e9a35606e6905b803a6301b754154f |
--- /dev/null |
+++ b/LayoutTests/fast/css/pseudo-not-empty-adjacent-dynamic.html |
@@ -0,0 +1,24 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/js-test.js"></script> |
+<style> |
+#empty:not(:empty) + div { background-color: green; } |
+</style> |
+<div id="empty"></div> |
+<div id="sibling">This text should be green</div> |
+<script> |
+description("Check that the sibling of an element that becomes :not(:empty) is properly recalculated"); |
+ |
+var transparent = "rgba(0, 0, 0, 0)"; |
+var green = "rgb(0, 128, 0)"; |
+ |
+empty.offsetTop; // force recalc |
+empty.style.color = "red"; // force LocalStyleChange on #empty |
+empty.offsetTop; // force recalc |
+ |
+shouldBe("getComputedStyle(sibling, '').backgroundColor", "transparent"); |
+ |
+empty.appendChild(document.createElement("div")); |
+empty.offsetTop; // force recalc |
+ |
+shouldBe("getComputedStyle(sibling, '').backgroundColor", "green"); |
+</script> |