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() |
{ |
} |