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

Side by Side Diff: LayoutTests/fast/css/invalidation/class-sibling-universal.html

Issue 1317533002: Sibling invalidation sets (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Invalidate descendants only Created 5 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script> 2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script> 3 <script src="../../../resources/testharnessreport.js"></script>
4 <style> 4 <style>
5 .t1 .sibling + *, 5 .t1 .sibling + *,
6 .t2 .sibling ~ *, 6 .t2 .sibling ~ *,
7 .t3 .sibling + :hover, 7 .t3 .sibling + :hover,
8 .t4 + .sibling, 8 .t4 + .sibling,
9 .t5 + *, 9 .t5 + *,
10 .t6 ~ .sibling { background-color: rgb(0, 128, 0); } 10 .t6 ~ .sibling,
11 .t7 + * + * .child,
12 .t8 + :-webkit-any(.sibling) * { background-color: rgb(0, 128, 0); }
11 13
12 #r3 { width: 10px; height: 10px } 14 #r3 { width: 10px; height: 10px }
13 </style> 15 </style>
14 <div> 16 <div>
15 <div id="t1"> 17 <div id="t1">
16 <div class="sibling"></div> 18 <div class="sibling"></div>
17 <div id="r1"></div> 19 <div id="r1"></div>
18 </div> 20 </div>
19 </div> 21 </div>
20 <div> 22 <div>
21 <div id="t2"> 23 <div id="t2">
22 <div class="sibling"></div> 24 <div class="sibling"></div>
23 <div></div> 25 <div></div>
24 <div id="r2"></div> 26 <div id="r2"></div>
25 </div> 27 </div>
26 </div> 28 </div>
27 <div> 29 <div>
28 <div id="t3"> 30 <div id="t3">
29 <div class="sibling"></div> 31 <div class="sibling"></div>
30 <div id="r3"></div> 32 <div id="r3"></div>
31 </div> 33 </div>
32 </div> 34 </div>
33 <div> 35 <div>
34 <div id="t4"></div> 36 <div id="t4"></div>
35 <div id="r4" class="sibling"> 37 <div id="r4" class="sibling">
36 <div></div> 38 <div></div>
37 <div></div> 39 <div></div>
38 </div> 40 </div>
41 <div class="sibling"></div>
39 </div> 42 </div>
40 <div> 43 <div>
41 <div id="t5"></div> 44 <div id="t5"></div>
42 <div id="r5"> 45 <div id="r5">
43 <div></div> 46 <div></div>
44 <div></div> 47 <div></div>
45 </div> 48 </div>
49 <div></div>
46 </div> 50 </div>
47 <div> 51 <div>
48 <div id="t6"></div> 52 <div id="t6"></div>
49 <div></div> 53 <div></div>
50 <div id="r6" class="sibling"> 54 <div id="r6" class="sibling">
51 <div></div> 55 <div></div>
52 <div></div> 56 <div></div>
53 </div> 57 </div>
58 <div></div>
59 </div>
60 <div>
61 <div id="t7">
62 <div class="child"></div>
63 </div>
64 <div>
65 <div class="child"></div>
66 <div></div>
67 </div>
68 <div>
69 <div id="r7" class="child"></div>
70 <div></div>
71 </div>
72 <div>
73 <div class="child"></div>
74 </div>
75 </div>
76 <div>
77 <div id="t8"></div>
78 <div class="sibling">
79 <div id="r8"></div>
80 </div>
54 </div> 81 </div>
55 <script> 82 <script>
56 document.body.offsetTop; 83 document.body.offsetTop;
57 84
58 test(function() { 85 test(function() {
59 assert_true(!!window.internals, "This test only works with internals exposed present"); 86 assert_true(!!window.internals, "This test only works with internals exposed present");
60 assert_equals(getComputedStyle(r1).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent"); 87 assert_equals(getComputedStyle(r1).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent");
61 88
62 t1.className = "t1"; 89 t1.className = "t1";
63 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt ree style recalc"); 90 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt ree style recalc");
(...skipping 19 matching lines...) Expand all
83 t3.className = "t3"; 110 t3.className = "t3";
84 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt ree style recalc"); 111 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt ree style recalc");
85 assert_equals(getComputedStyle(r3).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change"); 112 assert_equals(getComputedStyle(r3).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change");
86 }, "Adjacent with universal :hover selector"); 113 }, "Adjacent with universal :hover selector");
87 114
88 test(function() { 115 test(function() {
89 assert_true(!!window.internals, "This test only works with internals exposed present"); 116 assert_true(!!window.internals, "This test only works with internals exposed present");
90 assert_equals(getComputedStyle(r4).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent"); 117 assert_equals(getComputedStyle(r4).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent");
91 118
92 t4.className = "t4"; 119 t4.className = "t4";
93 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 4, "Subt ree style recalc"); 120 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Subt ree style recalc");
94 assert_equals(getComputedStyle(r4).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change"); 121 assert_equals(getComputedStyle(r4).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change");
95 }, "Class change affecting selector for sibling class"); 122 }, "Class change affecting selector for sibling class");
96 123
97 test(function() { 124 test(function() {
98 assert_true(!!window.internals, "This test only works with internals exposed present"); 125 assert_true(!!window.internals, "This test only works with internals exposed present");
99 assert_equals(getComputedStyle(r5).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent"); 126 assert_equals(getComputedStyle(r5).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent");
100 127
101 t5.className = "t5"; 128 t5.className = "t5";
102 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 4, "Subt ree style recalc"); 129 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Subt ree style recalc");
103 assert_equals(getComputedStyle(r5).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change"); 130 assert_equals(getComputedStyle(r5).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change");
104 }, "Class change affecting all sibling subtrees through a universal selector"); 131 }, "Class change affecting all sibling subtrees through a universal selector");
105 132
106 test(function() { 133 test(function() {
107 assert_true(!!window.internals, "This test only works with internals exposed present"); 134 assert_true(!!window.internals, "This test only works with internals exposed present");
108 assert_equals(getComputedStyle(r6).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent"); 135 assert_equals(getComputedStyle(r6).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent");
109 136
110 t6.className = "t6"; 137 t6.className = "t6";
111 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 5, "Subt ree style recalc"); 138 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Subt ree style recalc");
112 assert_equals(getComputedStyle(r6).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change"); 139 assert_equals(getComputedStyle(r6).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change");
113 }, "Class change affecting all sibling subtrees through an indirect adjacent com binator"); 140 }, "Class change affecting all sibling subtrees through an indirect adjacent com binator");
141
142 test(function() {
143 assert_true(!!window.internals, "This test only works with internals exposed present");
144 assert_equals(getComputedStyle(r7).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent");
145
146 t7.className = "t7";
147 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Subt ree style recalc");
148 assert_equals(getComputedStyle(r7).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change");
149 }, "Class change affecting sibling descendants through a universal selector");
150
151 test(function() {
152 assert_true(!!window.internals, "This test only works with internals exposed present");
153 assert_equals(getComputedStyle(r8).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent");
154
155 t8.className = "t8";
156 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Subt ree style recalc");
157 assert_equals(getComputedStyle(r8).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change");
158 }, "Class change affecting universal descendants of webkit-any sibling");
159
114 </script> 160 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698