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

Side by Side 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, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/RuleFeature.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <style>
5 /* Dummy rule for increasing max-direct-adjacent */
6 .x + .x + .x + .x { color: red }
7
8 span { color: green }
9 .a + .d, .b + .c { color: red }
10 </style>
11 <div id="insertTest">
12 <span class="a"></span>
13 <span class="b"></span>
14 <span class="c"></span>
15 <span class="d"></span>
16 </div>
17 <div id="removeTest">
18 <span class="a"></span>
19 <span class="b"></span>
20 <span class="c"></span>
21 <span class="d"></span>
22 </div>
23 <script>
24 test(() =>
25 assert_not_equals(window.internals, undefined, "Check that window.intern als is defined.")
26 , "window.internals required for tests.");
27
28 test(() => {
29 var c = insertTest.querySelector(".c");
30 assert_equals(getComputedStyle(c).color, "rgb(255, 0, 0)", "Check that . c is initially red.");
31
32 insertTest.insertBefore(document.createElement("span"), c);
33
34 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, " Recalc for the inserted element and .c.");
35 assert_equals(getComputedStyle(c).color, "rgb(0, 128, 0)", "Check that . c is green after insertion.");
36 }, "Check that we don't invalidate too much on sibling insertion.");
37
38 test(() => {
39 var c = removeTest.querySelector(".c");
40 assert_equals(getComputedStyle(c).color, "rgb(255, 0, 0)", "Check that . c is initially red.");
41
42 removeTest.querySelector(".b").remove();
43
44 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, " Recalc for .c.");
45 assert_equals(getComputedStyle(c).color, "rgb(0, 128, 0)", "Check that . c is green after .b is removed.");
46 }, "Check that we don't invalidate too much on sibling removal.");
47 </script>
OLDNEW
« 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