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..899c524dbf2db2d8f31789749d536d4a8fc5a173 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 (other.getRuleSetAnalyzer()) |
|
esprehn
2014/01/14 21:32:56
if (RuleSetAnalyzer* analyzer = ...)
analyzer->.
chrishtr
2014/01/14 23:33:00
Done.
|
| + ensureRuleSetAnalyzer()->combine(*other.getRuleSetAnalyzer()); |
| + |
| 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::getRuleSetAnalyzer() const |
| +{ |
| + return ruleSetAnalyzer.get(); |
| +} |
| + |
| +RuleSetAnalyzer* RuleFeatureSet::ensureRuleSetAnalyzer() |
| +{ |
| + if (!ruleSetAnalyzer) |
| + ruleSetAnalyzer = RuleSetAnalyzer::create(); |
| + return ruleSetAnalyzer.get(); |
| +} |
| + |
| } // namespace WebCore |