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

Side by Side Diff: LayoutTests/fast/css/invalidation/compound.html

Issue 1317533002: Sibling invalidation sets (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: sibling-inserted 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
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <style>
5 .t1 span.c#r1,
6 .t2 *.c#r2,
7 .t3 span.c,
8 .t4 *.ca.cb,
9 .t5 :-webkit-any(div.ca.cb, *.cc.cd#r5b),
10 .t6 ~ div > span.c#r6,
11 .t7 ~ div > span.c,
12 .t8 + * ~ div.c#p8 span,
13 .t9 + * ~ div.c span,
14 .t10 + div > :-webkit-any(div.ca.cb, *.cc.cd#r10b) { background-color: rgb(0, 12 8, 0); }
15 </style>
16 <div>
17 <div id="t1">
18 <div></div>
19 <div class="c"></div>
20 <span></span>
21 <span class="c"></span>
22 <span class="c" id="r1"></span>
23 </div>
24 </div>
25 <div>
26 <div id="t2">
27 <span></span>
28 <span class="c"></span>
29 <span class="c" id="r2"></span>
30 </div>
31 </div>
32 <div>
33 <div id="t3">
34 <div></div>
35 <div class="c"></div>
36 <span></span>
37 <span class="c" id="r3"></span>
38 </div>
39 </div>
40 <div>
41 <div id="t4">
42 <span></span>
43 <span class="ca"></span>
44 <span class="cb"></span>
45 <span class="ca cb" id="r4"></span>
46 </div>
47 </div>
48 <div>
49 <div id="t5">
50 <div></div>
51 <span></span>
52 <fieldset></fieldset>
53 <fieldset class="ca"></fieldset>
54 <fieldset class="cc cd"></fieldset>
55 <div class="ca cb" id="r5a"></div>
56 <span class="cc cd" id="r5b"></span>
57 </div>
58 </div>
59 <div>
60 <div id="t6"></div>
61 <div>
62 <div class="c"></div>
63 <span></span>
64 <span class="c"></span>
65 <span class="c" id="r6"></span>
66 </div>
67 </div>
68 <div>
69 <div id="t7"></div>
70 <div>
71 <div class="c"></div>
72 <span></span>
73 <span class="c" id="r7"></span>
74 </div>
75 </div>
76 <div>
77 <div id="t8"></div>
78 <span>
79 <span></span>
80 </span>
81 <span class="c">
82 <span></span>
83 </span>
84 <div>
85 <span></span>
86 </div>
87 <div class="c">
88 <span></span>
89 </div>
90 <div class="c" id="p8">
91 <span id="r8"></span>
92 </div>
93 </div>
94 <div>
95 <div id="t9"></div>
96 <span>
97 <span></span>
98 </span>
99 <span class="c">
100 <span></span>
101 </span>
102 <div>
103 <span></span>
104 </div>
105 <div class="c">
106 <span id="r9"></span>
107 </div>
108 </div>
109 <div>
110 <div id="t10"></div>
111 <div>
112 <div></div>
113 <span></span>
114 <fieldset></fieldset>
115 <fieldset class="ca"></fieldset>
116 <fieldset class="cc cd"></fieldset>
117 <div class="ca cb" id="r10a"></div>
118 <span class="cc cd" id="r10b"></span>
119 </div>
120 </div>
121
122 <script>
123 document.body.offsetTop;
124
125 test(function() {
126 assert_true(!!window.internals, "This test only works with internals exposed present");
127 assert_equals(getComputedStyle(r1).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent");
128
129 t1.className = "t1";
130 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 5, "Subt ree style recalc");
131 assert_equals(getComputedStyle(r1).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change");
132 }, "Descendant with compound selector containing id");
133
134 test(function() {
135 assert_true(!!window.internals, "This test only works with internals exposed present");
136 assert_equals(getComputedStyle(r2).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent");
137
138 t2.className = "t2";
139 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt ree style recalc");
140 assert_equals(getComputedStyle(r2).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change");
141 }, "Descendant with compound selector containing universal and id");
142
143 test(function() {
144 assert_true(!!window.internals, "This test only works with internals exposed present");
145 assert_equals(getComputedStyle(r3).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent");
146
147 t3.className = "t3";
148 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 4, "Subt ree style recalc");
149 assert_equals(getComputedStyle(r3).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change");
150 }, "Descendant with compound selector");
151
152 test(function() {
153 assert_true(!!window.internals, "This test only works with internals exposed present");
154 assert_equals(getComputedStyle(r4).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent");
155
156 t4.className = "t4";
157 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 4, "Subt ree style recalc");
158 assert_equals(getComputedStyle(r4).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change");
159 }, "Descendant with compound selector containing universal");
160
161 test(function() {
162 assert_true(!!window.internals, "This test only works with internals exposed present");
163 assert_equals(getComputedStyle(r5a).backgroundColor, "rgba(0, 0, 0, 0)", "Ba ckground color a should initially be transparent");
164 assert_equals(getComputedStyle(r5b).backgroundColor, "rgba(0, 0, 0, 0)", "Ba ckground color b should initially be transparent");
165
166 t5.className = "t5";
167 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 6, "Subt ree style recalc");
168 assert_equals(getComputedStyle(r5a).backgroundColor, "rgb(0, 128, 0)", "Back ground color a is green after class change");
169 assert_equals(getComputedStyle(r5b).backgroundColor, "rgb(0, 128, 0)", "Back ground color b is green after class change");
170 }, "Descendant with :-webkit-any containing compound selector");
171
172 test(function() {
173 assert_true(!!window.internals, "This test only works with internals exposed present");
174 assert_equals(getComputedStyle(r6).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent");
175
176 t6.className = "t6";
177 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 4, "Subt ree style recalc");
178 assert_equals(getComputedStyle(r6).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change");
179 }, "Sibling with compound descendant containing id");
180
181 test(function() {
182 assert_true(!!window.internals, "This test only works with internals exposed present");
183 assert_equals(getComputedStyle(r7).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent");
184
185 t7.className = "t7";
186 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt ree style recalc");
187 assert_equals(getComputedStyle(r7).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change");
188 }, "Sibling with compound descendant");
189
190 test(function() {
191 assert_true(!!window.internals, "This test only works with internals exposed present");
192 assert_equals(getComputedStyle(r8).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent");
193
194 t8.className = "t8";
195 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 4, "Subt ree style recalc");
196 assert_equals(getComputedStyle(r8).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change");
197 }, "Compound sibling selector containing id");
198
199 test(function() {
200 assert_true(!!window.internals, "This test only works with internals exposed present");
201 assert_equals(getComputedStyle(r9).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent");
202
203 t9.className = "t9";
204 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt ree style recalc");
205 assert_equals(getComputedStyle(r9).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change");
206 }, "Compound sibling selector");
207
208 test(function() {
209 assert_true(!!window.internals, "This test only works with internals exposed present");
210 assert_equals(getComputedStyle(r10a).backgroundColor, "rgba(0, 0, 0, 0)", "B ackground color a should initially be transparent");
211 assert_equals(getComputedStyle(r10b).backgroundColor, "rgba(0, 0, 0, 0)", "B ackground color b should initially be transparent");
212
213 t10.className = "t10";
214 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 5, "Subt ree style recalc");
215 assert_equals(getComputedStyle(r10a).backgroundColor, "rgb(0, 128, 0)", "Bac kground color a is green after class change");
216 assert_equals(getComputedStyle(r10b).backgroundColor, "rgb(0, 128, 0)", "Bac kground color b is green after class change");
217 }, "Sibling with descendant :-webkit-any containing compound selector");
218
219 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698