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

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

Issue 27537009: Avoid always style recalc when removing stylesheets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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/resolver/ScopedStyleResolver.cpp
diff --git a/Source/core/css/resolver/ScopedStyleResolver.cpp b/Source/core/css/resolver/ScopedStyleResolver.cpp
index 3bc70ed09d42c1ab762c5ffee02fab9c954cb112..3a3f8e6c5b1c65ceb7c46d36c92dde8d225f02f1 100644
--- a/Source/core/css/resolver/ScopedStyleResolver.cpp
+++ b/Source/core/css/resolver/ScopedStyleResolver.cpp
@@ -54,12 +54,11 @@ ScopedStyleResolver* ScopedStyleTree::ensureScopedStyleResolver(const ContainerN
ScopedStyleResolver* ScopedStyleTree::scopedStyleResolverFor(const ContainerNode& scopingNode)
{
if (!scopingNode.hasScopedHTMLStyleChild()
- && !(scopingNode.isElementNode() && toElement(scopingNode).shadow())
+ && !isShadowHost(&scopingNode)
&& !scopingNode.isDocumentNode()
&& !scopingNode.isShadowRoot())
return 0;
- HashMap<const ContainerNode*, OwnPtr<ScopedStyleResolver> >::iterator it = m_authorStyles.find(&scopingNode);
- return it != m_authorStyles.end() ? it->value.get() : 0;
+ return lookupScopedStyleResolverFor(&scopingNode);
}
ScopedStyleResolver* ScopedStyleTree::addScopedStyleResolver(const ContainerNode& scopingNode, bool& isNewEntry)

Powered by Google App Engine
This is Rietveld 408576698