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

Unified Diff: LayoutTests/fast/css/next-sibling-changed.html

Issue 24350009: Reverse style resolution to avoid N^2 walk when building the render tree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merge to ToT Created 7 years, 2 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
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>

Powered by Google App Engine
This is Rietveld 408576698