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

Side by Side Diff: third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp

Issue 1424783003: CSS: Use UINT_MAX for ~ sibling invalidation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/css/RuleFeature.h" 6 #include "core/css/RuleFeature.h"
7 7
8 #include "core/css/CSSSelectorList.h" 8 #include "core/css/CSSSelectorList.h"
9 #include "core/css/RuleSet.h" 9 #include "core/css/RuleSet.h"
10 #include "core/css/StylePropertySet.h" 10 #include "core/css/StylePropertySet.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 expectSiblingDescendantInvalidation(1, "n", "p", invalidationLists.siblings) ; 219 expectSiblingDescendantInvalidation(1, "n", "p", invalidationLists.siblings) ;
220 } 220 }
221 221
222 TEST_F(RuleFeatureSetTest, interleavedDescendantSibling5) 222 TEST_F(RuleFeatureSetTest, interleavedDescendantSibling5)
223 { 223 {
224 updateInvalidationSets(".l ~ .m + .n .o + .p"); 224 updateInvalidationSets(".l ~ .m + .n .o + .p");
225 225
226 InvalidationLists invalidationLists; 226 InvalidationLists invalidationLists;
227 collectInvalidationSetsForClass(invalidationLists, "l"); 227 collectInvalidationSetsForClass(invalidationLists, "l");
228 expectNoInvalidation(invalidationLists.descendants); 228 expectNoInvalidation(invalidationLists.descendants);
229 expectSiblingDescendantInvalidation(std::numeric_limits<unsigned>::max(), "n ", "p", invalidationLists.siblings); 229 expectSiblingDescendantInvalidation(UINT_MAX, "n", "p", invalidationLists.si blings);
230 } 230 }
231 231
232 TEST_F(RuleFeatureSetTest, interleavedDescendantSibling6) 232 TEST_F(RuleFeatureSetTest, interleavedDescendantSibling6)
233 { 233 {
234 updateInvalidationSets(".k > .l ~ .m + .n .o + .p"); 234 updateInvalidationSets(".k > .l ~ .m + .n .o + .p");
235 235
236 InvalidationLists invalidationLists; 236 InvalidationLists invalidationLists;
237 collectInvalidationSetsForClass(invalidationLists, "k"); 237 collectInvalidationSetsForClass(invalidationLists, "k");
238 expectClassInvalidation("p", invalidationLists.descendants); 238 expectClassInvalidation("p", invalidationLists.descendants);
239 expectNoInvalidation(invalidationLists.siblings); 239 expectNoInvalidation(invalidationLists.siblings);
240 } 240 }
241 241
242 242
243 TEST_F(RuleFeatureSetTest, anySibling) 243 TEST_F(RuleFeatureSetTest, anySibling)
244 { 244 {
245 updateInvalidationSets(":-webkit-any(.q, .r) ~ .s .t"); 245 updateInvalidationSets(":-webkit-any(.q, .r) ~ .s .t");
246 246
247 InvalidationLists invalidationLists; 247 InvalidationLists invalidationLists;
248 collectInvalidationSetsForClass(invalidationLists, "q"); 248 collectInvalidationSetsForClass(invalidationLists, "q");
249 expectNoInvalidation(invalidationLists.descendants); 249 expectNoInvalidation(invalidationLists.descendants);
250 expectSiblingDescendantInvalidation(std::numeric_limits<unsigned>::max(), "s ", "t", invalidationLists.siblings); 250 expectSiblingDescendantInvalidation(UINT_MAX, "s", "t", invalidationLists.si blings);
251 } 251 }
252 252
253 TEST_F(RuleFeatureSetTest, any) 253 TEST_F(RuleFeatureSetTest, any)
254 { 254 {
255 updateInvalidationSets(":-webkit-any(.w, .x)"); 255 updateInvalidationSets(":-webkit-any(.w, .x)");
256 256
257 InvalidationLists invalidationLists; 257 InvalidationLists invalidationLists;
258 collectInvalidationSetsForClass(invalidationLists, "w"); 258 collectInvalidationSetsForClass(invalidationLists, "w");
259 expectSelfInvalidation(invalidationLists.descendants); 259 expectSelfInvalidation(invalidationLists.descendants);
260 expectNoInvalidation(invalidationLists.siblings); 260 expectNoInvalidation(invalidationLists.siblings);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 TEST_F(RuleFeatureSetTest, tagName) 310 TEST_F(RuleFeatureSetTest, tagName)
311 { 311 {
312 updateInvalidationSets(":valid e"); 312 updateInvalidationSets(":valid e");
313 313
314 InvalidationLists invalidationLists; 314 InvalidationLists invalidationLists;
315 collectInvalidationSetsForPseudoClass(invalidationLists, CSSSelector::Pseudo Valid); 315 collectInvalidationSetsForPseudoClass(invalidationLists, CSSSelector::Pseudo Valid);
316 expectTagNameInvalidation("e", invalidationLists.descendants); 316 expectTagNameInvalidation("e", invalidationLists.descendants);
317 } 317 }
318 318
319 } // namespace blink 319 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698