OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |