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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/invalidation/reattach-with-sibling-invalidation.html

Issue 1533683002: Persist invalidation sets on detach root (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Avoid detaching when in inactive state Created 5 years 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/invalidation/reattach-with-sibling-invalidation-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/invalidation/reattach-with-sibling-invalidation.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/invalidation/reattach-with-sibling-invalidation.html b/third_party/WebKit/LayoutTests/fast/css/invalidation/reattach-with-sibling-invalidation.html
new file mode 100644
index 0000000000000000000000000000000000000000..a8b5a53858eac0d234e8fa98e00edb8adb58c0bf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/invalidation/reattach-with-sibling-invalidation.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<style>
+ .b { color: red }
+ .a + div .b { color: green }
+</style>
+<input type="text"></input>
+<div>
+ <span class="b">Should be green</span>
+ <span></span>
+ <span></span>
+ <span></span>
+</div>
+<script>
+ description("A reattach should not discard a scheduled sibling invalidation.");
+
+ var input = document.querySelector("input");
+
+ shouldBeEqualToString("getComputedStyle(document.querySelector('.b')).color", "rgb(255, 0, 0)");
+
+ // Force clean style+layout
+ input.offsetTop;
+
+ // Schedule sibling invalidation set to invalidate span.b
+ input.className = "a";
+
+ // Trigger lazyReattachIfAttached() -> detach().
+ document.querySelector("input").type = "button";
+
+ // The expected count will be 2 when ContainerNode::checkForChildrenAdjacentRuleChanges()
+ // is removed. One for attaching the input, and one for the span.b recalc.
+ if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "6");
+
+ shouldBeEqualToString("getComputedStyle(document.querySelector('.b')).color", "rgb(0, 128, 0)");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/invalidation/reattach-with-sibling-invalidation-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698