| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 | 248 |
| 249 void expectAttributeInvalidation(const AtomicString& attribute, | 249 void expectAttributeInvalidation(const AtomicString& attribute, |
| 250 InvalidationSetVector& invalidationSets) { | 250 InvalidationSetVector& invalidationSets) { |
| 251 EXPECT_EQ(1u, invalidationSets.size()); | 251 EXPECT_EQ(1u, invalidationSets.size()); |
| 252 HashSet<AtomicString> attributes = attributeSet(*invalidationSets[0]); | 252 HashSet<AtomicString> attributes = attributeSet(*invalidationSets[0]); |
| 253 EXPECT_EQ(1u, attributes.size()); | 253 EXPECT_EQ(1u, attributes.size()); |
| 254 EXPECT_TRUE(attributes.contains(attribute)); | 254 EXPECT_TRUE(attributes.contains(attribute)); |
| 255 } | 255 } |
| 256 | 256 |
| 257 void expectSiblingRuleCount(unsigned count) { | 257 void expectSiblingRuleCount(unsigned count) { |
| 258 EXPECT_EQ(count, m_ruleFeatureSet->siblingRules.size()); | 258 EXPECT_EQ(count, m_ruleFeatureSet->siblingRules().size()); |
| 259 } | 259 } |
| 260 | 260 |
| 261 void expectUncommonAttributeRuleCount(unsigned count) { | 261 void expectUncommonAttributeRuleCount(unsigned count) { |
| 262 EXPECT_EQ(count, m_ruleFeatureSet->uncommonAttributeRules.size()); | 262 EXPECT_EQ(count, m_ruleFeatureSet->uncommonAttributeRules().size()); |
| 263 } | 263 } |
| 264 | 264 |
| 265 void expectFullRecalcForRuleSetInvalidation(bool expected) { | 265 void expectFullRecalcForRuleSetInvalidation(bool expected) { |
| 266 EXPECT_EQ(expected, | 266 EXPECT_EQ(expected, |
| 267 m_ruleFeatureSet->needsFullRecalcForRuleSetInvalidation()); | 267 m_ruleFeatureSet->needsFullRecalcForRuleSetInvalidation()); |
| 268 } | 268 } |
| 269 | 269 |
| 270 private: | 270 private: |
| 271 PersistentPartObject<RuleFeatureSet> m_ruleFeatureSet; | 271 PersistentPartObject<RuleFeatureSet> m_ruleFeatureSet; |
| 272 Persistent<Document> m_document; | 272 Persistent<Document> m_document; |
| (...skipping 779 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 |