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

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

Issue 1695393002: Don't add to siblingRules for features left of ::slotted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « third_party/WebKit/Source/core/css/RuleFeature.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "core/css/RuleFeature.h" 5 #include "core/css/RuleFeature.h"
6 6
7 #include "core/css/CSSSelectorList.h" 7 #include "core/css/CSSSelectorList.h"
8 #include "core/css/RuleSet.h" 8 #include "core/css/RuleSet.h"
9 #include "core/css/StylePropertySet.h" 9 #include "core/css/StylePropertySet.h"
10 #include "core/css/StyleRule.h" 10 #include "core/css/StyleRule.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 collectInvalidationSetsForClass(invalidationLists, "a"); 350 collectInvalidationSetsForClass(invalidationLists, "a");
351 expectClassesInvalidation("b", "c", invalidationLists.descendants); 351 expectClassesInvalidation("b", "c", invalidationLists.descendants);
352 } 352 }
353 353
354 TEST_F(RuleFeatureSetTest, siblingRulesBeforeContentPseudo) 354 TEST_F(RuleFeatureSetTest, siblingRulesBeforeContentPseudo)
355 { 355 {
356 collectFeatures("a + b ::content .c"); 356 collectFeatures("a + b ::content .c");
357 expectSiblingRuleCount(0); 357 expectSiblingRuleCount(0);
358 } 358 }
359 359
360 TEST_F(RuleFeatureSetTest, siblingRulesBeforeContentPseudo2)
361 {
362 collectFeatures("a + ::content .b");
363 expectSiblingRuleCount(0);
364 }
365
360 TEST_F(RuleFeatureSetTest, siblingRulesAfterContentPseudo) 366 TEST_F(RuleFeatureSetTest, siblingRulesAfterContentPseudo)
361 { 367 {
362 collectFeatures(".a ::content .b + .c"); 368 collectFeatures(".a ::content .b + .c");
363 expectSiblingRuleCount(1); 369 expectSiblingRuleCount(1);
364 } 370 }
365 371
366 TEST_F(RuleFeatureSetTest, siblingRulesNthBeforeContentPseudo) 372 TEST_F(RuleFeatureSetTest, siblingRulesNthBeforeContentPseudo)
367 { 373 {
368 collectFeatures(":nth-child(2) ::content .a"); 374 collectFeatures(":nth-child(2) ::content .a");
369 expectSiblingRuleCount(0); 375 expectSiblingRuleCount(0);
(...skipping 25 matching lines...) Expand all
395 401
396 TEST_F(RuleFeatureSetTest, siblingRulesAfterShadow) 402 TEST_F(RuleFeatureSetTest, siblingRulesAfterShadow)
397 { 403 {
398 collectFeatures(".a ::shadow .b + .c"); 404 collectFeatures(".a ::shadow .b + .c");
399 expectSiblingRuleCount(1); 405 expectSiblingRuleCount(1);
400 } 406 }
401 407
402 TEST_F(RuleFeatureSetTest, siblingRulesBeforeSlotted) 408 TEST_F(RuleFeatureSetTest, siblingRulesBeforeSlotted)
403 { 409 {
404 collectFeatures(".a + ::slotted(.b)"); 410 collectFeatures(".a + ::slotted(.b)");
405 expectSiblingRuleCount(1); 411 expectSiblingRuleCount(0);
412 }
413
414 TEST_F(RuleFeatureSetTest, siblingRulesBeforeHost)
415 {
416 collectFeatures(".a + :host(.b)");
417 expectSiblingRuleCount(0);
418 }
419
420 TEST_F(RuleFeatureSetTest, siblingRulesBeforeHostContext)
421 {
422 collectFeatures(".a + :host-context(.b)");
423 expectSiblingRuleCount(0);
406 } 424 }
407 425
408 } // namespace blink 426 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleFeature.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698