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

Unified Diff: Source/core/css/resolver/ScopedStyleTree.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.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/ScopedStyleTree.cpp
diff --git a/Source/core/css/resolver/ScopedStyleTree.cpp b/Source/core/css/resolver/ScopedStyleTree.cpp
index 1938fd79218a580acbccddf50bdac9e35a43fc99..3fb5a45ed95c31615436223493f525f2943475bf 100644
--- a/Source/core/css/resolver/ScopedStyleTree.cpp
+++ b/Source/core/css/resolver/ScopedStyleTree.cpp
@@ -34,6 +34,8 @@
namespace WebCore {
+class StyleSheetContents;
+
ScopedStyleResolver* ScopedStyleTree::ensureScopedStyleResolver(ContainerNode& scopingNode)
{
bool isNewEntry;
@@ -191,8 +193,9 @@ void ScopedStyleTree::popStyleCache(const ContainerNode& scopingNode)
void ScopedStyleTree::collectFeaturesTo(RuleFeatureSet& features)
{
+ HashSet<const StyleSheetContents*> visitedSharedStyleSheetContents;
for (HashMap<const ContainerNode*, OwnPtr<ScopedStyleResolver> >::iterator it = m_authorStyles.begin(); it != m_authorStyles.end(); ++it)
- it->value->collectFeaturesTo(features);
+ it->value->collectFeaturesTo(features, visitedSharedStyleSheetContents);
}
inline void ScopedStyleTree::reparentNodes(const ScopedStyleResolver* oldParent, ScopedStyleResolver* newParent)
« no previous file with comments | « Source/core/css/resolver/ScopedStyleResolver.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698