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 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 expectFullRecalcForRuleSetInvalidation(false); | 993 expectFullRecalcForRuleSetInvalidation(false); |
994 clearFeatures(); | 994 clearFeatures(); |
995 | 995 |
996 EXPECT_EQ(RuleFeatureSet::SelectorMayMatch, collectFeatures(":not(.x) + .y")); | 996 EXPECT_EQ(RuleFeatureSet::SelectorMayMatch, collectFeatures(":not(.x) + .y")); |
997 expectFullRecalcForRuleSetInvalidation(false); | 997 expectFullRecalcForRuleSetInvalidation(false); |
998 } | 998 } |
999 | 999 |
1000 TEST_F(RuleFeatureSetTest, RuleSetInvalidationCustomPseudo) { | 1000 TEST_F(RuleFeatureSetTest, RuleSetInvalidationCustomPseudo) { |
1001 EXPECT_EQ(RuleFeatureSet::SelectorMayMatch, | 1001 EXPECT_EQ(RuleFeatureSet::SelectorMayMatch, |
1002 collectFeatures("::-webkit-slider-thumb")); | 1002 collectFeatures("::-webkit-slider-thumb")); |
1003 expectFullRecalcForRuleSetInvalidation(true); | 1003 expectFullRecalcForRuleSetInvalidation(false); |
1004 clearFeatures(); | 1004 clearFeatures(); |
1005 | 1005 |
1006 EXPECT_EQ(RuleFeatureSet::SelectorMayMatch, | 1006 EXPECT_EQ(RuleFeatureSet::SelectorMayMatch, |
1007 collectFeatures(".x::-webkit-slider-thumb")); | 1007 collectFeatures(".x::-webkit-slider-thumb")); |
1008 expectFullRecalcForRuleSetInvalidation(false); | 1008 expectFullRecalcForRuleSetInvalidation(false); |
1009 clearFeatures(); | 1009 clearFeatures(); |
1010 | 1010 |
1011 EXPECT_EQ(RuleFeatureSet::SelectorMayMatch, | 1011 EXPECT_EQ(RuleFeatureSet::SelectorMayMatch, |
1012 collectFeatures(".x + ::-webkit-slider-thumb")); | 1012 collectFeatures(".x + ::-webkit-slider-thumb")); |
1013 expectFullRecalcForRuleSetInvalidation(false); | 1013 expectFullRecalcForRuleSetInvalidation(false); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 collectFeatures(":-webkit-any(:-webkit-any(.a, *), #x)")); | 1052 collectFeatures(":-webkit-any(:-webkit-any(.a, *), #x)")); |
1053 expectFullRecalcForRuleSetInvalidation(true); | 1053 expectFullRecalcForRuleSetInvalidation(true); |
1054 clearFeatures(); | 1054 clearFeatures(); |
1055 | 1055 |
1056 EXPECT_EQ(RuleFeatureSet::SelectorMayMatch, | 1056 EXPECT_EQ(RuleFeatureSet::SelectorMayMatch, |
1057 collectFeatures(":-webkit-any(*, .a) *")); | 1057 collectFeatures(":-webkit-any(*, .a) *")); |
1058 expectFullRecalcForRuleSetInvalidation(true); | 1058 expectFullRecalcForRuleSetInvalidation(true); |
1059 } | 1059 } |
1060 | 1060 |
1061 } // namespace blink | 1061 } // namespace blink |
OLD | NEW |