Chromium Code Reviews (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out

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://
Patch Set: Fixing loops in Regions Created 7 years, 3 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>
+<div id="div1"></div>
+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');
+var testDiv = document.createElement('div'); = "testDiv";
+var style = document.createElement('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 src="../js/resources/js-test-post.js"></script>

Powered by Google App Engine
This is Rietveld 408576698