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

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: Fixed typos. 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..f693b844c944a704df05b6252e5f4f6aa7efe941 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.getRuleSetAnalyzer())
+ 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::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