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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/invalidation/sibling-mutation-min-direct.html

Issue 2116503002: Skip scheduling sibling invalidation based on direct adjacent count. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/RuleFeature.h » ('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/sibling-mutation-min-direct.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/invalidation/sibling-mutation-min-direct.html b/third_party/WebKit/LayoutTests/fast/css/invalidation/sibling-mutation-min-direct.html
new file mode 100644
index 0000000000000000000000000000000000000000..ec5d1baa032a946f7eb048e69b7d238ec14c8979
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/invalidation/sibling-mutation-min-direct.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<style>
+ /* Dummy rule for increasing max-direct-adjacent */
+ .x + .x + .x + .x { color: red }
+
+ span { color: green }
+ .a + .d, .b + .c { color: red }
+</style>
+<div id="insertTest">
+ <span class="a"></span>
+ <span class="b"></span>
+ <span class="c"></span>
+ <span class="d"></span>
+</div>
+<div id="removeTest">
+ <span class="a"></span>
+ <span class="b"></span>
+ <span class="c"></span>
+ <span class="d"></span>
+</div>
+<script>
+ test(() =>
+ assert_not_equals(window.internals, undefined, "Check that window.internals is defined.")
+ , "window.internals required for tests.");
+
+ test(() => {
+ var c = insertTest.querySelector(".c");
+ assert_equals(getComputedStyle(c).color, "rgb(255, 0, 0)", "Check that .c is initially red.");
+
+ insertTest.insertBefore(document.createElement("span"), c);
+
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Recalc for the inserted element and .c.");
+ assert_equals(getComputedStyle(c).color, "rgb(0, 128, 0)", "Check that .c is green after insertion.");
+ }, "Check that we don't invalidate too much on sibling insertion.");
+
+ test(() => {
+ var c = removeTest.querySelector(".c");
+ assert_equals(getComputedStyle(c).color, "rgb(255, 0, 0)", "Check that .c is initially red.");
+
+ removeTest.querySelector(".b").remove();
+
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Recalc for .c.");
+ assert_equals(getComputedStyle(c).color, "rgb(0, 128, 0)", "Check that .c is green after .b is removed.");
+ }, "Check that we don't invalidate too much on sibling removal.");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/RuleFeature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698