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

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

Issue 772803002: Delay construction of StyleResolverState until after style sharing. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index e1db3dd6d754f30ebefbfdfc04b2668486223516..1d39ce659c8397fab8cfaae8213e400f299e4443 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -561,14 +561,16 @@ PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS
StyleResolverParentScope::ensureParentStackIsPushed();
- StyleResolverState state(document(), element, defaultParent);
+ ElementResolveContext elementContext(*element);
- if (sharingBehavior == AllowStyleSharing && state.parentStyle()) {
- SharedStyleFinder styleFinder(state.elementContext(), m_features, m_siblingRuleSet.get(), m_uncommonAttributeRuleSet.get(), *this);
+ if (sharingBehavior == AllowStyleSharing && (defaultParent || elementContext.parentStyle())) {
+ SharedStyleFinder styleFinder(elementContext, m_features, m_siblingRuleSet.get(), m_uncommonAttributeRuleSet.get(), *this);
if (RefPtr<RenderStyle> sharedStyle = styleFinder.findSharedStyle())
return sharedStyle.release();
}
+ StyleResolverState state(document(), elementContext, defaultParent);
andersr 2014/12/02 14:08:17 I ran blink_perf.css locally on this patch, and I
+
ActiveAnimations* activeAnimations = element->activeAnimations();
const RenderStyle* baseRenderStyle = activeAnimations ? activeAnimations->baseRenderStyle() : nullptr;

Powered by Google App Engine
This is Rietveld 408576698