Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Unified Diff: Source/core/css/RuleFeature.cpp

Issue 129633003: Add a first pass of a class descendant invalidator, and a containing RuleSetAnalyzer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Removed extra line. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698