Chromium Code Reviews| Index: Source/core/css/RuleFeature.cpp |
| diff --git a/Source/core/css/RuleFeature.cpp b/Source/core/css/RuleFeature.cpp |
| index 7c8f160ae43f4d7445289aeda1ee292c72301f55..d096a2f79fe743ef922de4730f518348394abe51 100644 |
| --- a/Source/core/css/RuleFeature.cpp |
| +++ b/Source/core/css/RuleFeature.cpp |
| @@ -69,6 +69,9 @@ void RuleFeatureSet::collectFeaturesFromSelectorList(const CSSSelectorList* sele |
| void RuleFeatureSet::add(const RuleFeatureSet& other) |
| { |
| + if (const RuleSetAnalyzer* otherAnalyzer = other.ruleSetAnalyzer()) |
| + ensureRuleSetAnalyzer()->combine(*otherAnalyzer); |
| + |
| HashSet<AtomicString>::const_iterator end = other.idsInRules.end(); |
| for (HashSet<AtomicString>::const_iterator it = other.idsInRules.begin(); it != end; ++it) |
| idsInRules.add(*it); |
| @@ -95,4 +98,16 @@ void RuleFeatureSet::clear() |
| m_maxDirectAdjacentSelectors = 0; |
| } |
| +const RuleSetAnalyzer* RuleFeatureSet::ruleSetAnalyzer() const |
| +{ |
| + return m_ruleSetAnalyzer.get(); |
| +} |
| + |
| +RuleSetAnalyzer* RuleFeatureSet::ensureRuleSetAnalyzer() |
| +{ |
| + if (!m_ruleSetAnalyzer) |
| + m_ruleSetAnalyzer = RuleSetAnalyzer::create(); |
| + return m_ruleSetAnalyzer.get(); |
|
esprehn
2014/01/16 20:11:48
return *m_ruleSetAnalyzer;
chrishtr
2014/01/16 20:46:22
Done.
|
| +} |
| + |
| } // namespace WebCore |