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

Unified Diff: Source/core/css/resolver/StyleResolverState.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/StyleResolverState.cpp
diff --git a/Source/core/css/resolver/StyleResolverState.cpp b/Source/core/css/resolver/StyleResolverState.cpp
index 798235740821e8c7b162749a717639b1cfa21564..66401bf51144299be70cc2386d9c1a6a46cb0f58 100644
--- a/Source/core/css/resolver/StyleResolverState.cpp
+++ b/Source/core/css/resolver/StyleResolverState.cpp
@@ -29,8 +29,8 @@
namespace blink {
-StyleResolverState::StyleResolverState(Document& document, Element* element, RenderStyle* parentStyle)
- : m_elementContext(element ? ElementResolveContext(*element) : ElementResolveContext(document))
+StyleResolverState::StyleResolverState(Document& document, const ElementResolveContext& elementContext, RenderStyle* parentStyle)
+ : m_elementContext(elementContext)
, m_document(document)
, m_style(nullptr)
, m_parentStyle(parentStyle)
@@ -39,13 +39,18 @@ StyleResolverState::StyleResolverState(Document& document, Element* element, Ren
, m_fontBuilder(document)
, m_styleMap(*this, m_elementStyleResources)
{
- if (!parentStyle && m_elementContext.parentNode())
- m_parentStyle = m_elementContext.parentNode()->renderStyle();
+ if (!m_parentStyle)
+ m_parentStyle = m_elementContext.parentStyle();
ASSERT(document.isActive());
m_elementStyleResources.setDeviceScaleFactor(document.frameHost()->deviceScaleFactor());
}
+StyleResolverState::StyleResolverState(Document& document, Element* element, RenderStyle* parentStyle)
+ : StyleResolverState(document, element ? ElementResolveContext(*element) : ElementResolveContext(document), parentStyle)
+{
+}
+
StyleResolverState::~StyleResolverState()
{
}
« Source/core/css/resolver/StyleResolver.cpp ('K') | « Source/core/css/resolver/StyleResolverState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698