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

Unified Diff: Source/core/css/resolver/ScopedStyleResolver.cpp

Issue 195903002: Only process each StyleSheetContents once when collecting features during style resolution (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Only hash shared stylesheets Created 6 years, 9 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
« no previous file with comments | « Source/core/css/resolver/ScopedStyleResolver.h ('k') | Source/core/css/resolver/ScopedStyleTree.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/ScopedStyleResolver.cpp
diff --git a/Source/core/css/resolver/ScopedStyleResolver.cpp b/Source/core/css/resolver/ScopedStyleResolver.cpp
index 5763d0d923e72ee9ec79b7b92f5b30ebbf234451..e9693d0db983be5de1d7ef746151382d52539841 100644
--- a/Source/core/css/resolver/ScopedStyleResolver.cpp
+++ b/Source/core/css/resolver/ScopedStyleResolver.cpp
@@ -78,10 +78,13 @@ void ScopedStyleResolver::addRulesFromSheet(CSSStyleSheet* cssSheet, const Media
resolver->processScopedRules(ruleSet, sheet->baseURL(), &m_scopingNode);
}
-void ScopedStyleResolver::collectFeaturesTo(RuleFeatureSet& features)
+void ScopedStyleResolver::collectFeaturesTo(RuleFeatureSet& features, HashSet<const StyleSheetContents*>& visitedSharedStyleSheetContents)
{
- for (size_t i = 0; i < m_authorStyleSheets.size(); ++i)
- features.add(m_authorStyleSheets[i]->contents()->ruleSet().features());
+ for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) {
+ StyleSheetContents* contents = m_authorStyleSheets[i]->contents();
+ if (contents->hasOneClient() || visitedSharedStyleSheetContents.add(contents).isNewEntry)
+ features.add(contents->ruleSet().features());
+ }
}
void ScopedStyleResolver::resetAuthorStyle()
« no previous file with comments | « Source/core/css/resolver/ScopedStyleResolver.h ('k') | Source/core/css/resolver/ScopedStyleTree.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698