Index: LayoutTests/fast/css/next-sibling-changed.html |
diff --git a/LayoutTests/fast/css/next-sibling-changed.html b/LayoutTests/fast/css/next-sibling-changed.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1e967d936aec06f012b324560ea2ea693d45e1ba |
--- /dev/null |
+++ b/LayoutTests/fast/css/next-sibling-changed.html |
@@ -0,0 +1,30 @@ |
+<!DOCTYPE html> |
+<script src="../js/resources/js-test-pre.js"></script> |
+<body> |
+<div id="div1"></div> |
+</body> |
+<script> |
+if (window.testRunner) |
+ testRunner.dumpAsText(); |
+ |
+description("This test ensures we properly invalidate style when adding children affected by direct adjacent sibling selectors."); |
+ |
+var div1 = document.getElementById('div1'); |
+var div2 = document.createElement('div'); |
+div1.appendChild(div2); |
+var testDiv = document.createElement('div'); |
+testDiv.id = "testDiv"; |
+div2.appendChild(testDiv); |
+var style = document.createElement('style'); |
+document.documentElement.firstChild.appendChild(style); |
+style.appendChild(document.createTextNode("#div1 > div + div > div { color: red; }\n")); |
+ |
+// Recalc style with our test div not matching the selector |
+document.defaultView.getComputedStyle(testDiv, "").color; |
+ |
+var trigger = document.createElement('div'); |
+div1.insertBefore(trigger, div2); |
+shouldBe('document.defaultView.getComputedStyle(testDiv).color', '"rgb(255, 0, 0)"'); |
+ |
+</script> |
+<script src="../js/resources/js-test-post.js"></script> |