Index: Source/core/css/resolver/ElementResolveContext.cpp |
diff --git a/Source/core/css/resolver/ElementResolveContext.cpp b/Source/core/css/resolver/ElementResolveContext.cpp |
index 40008283689d0ecd3035fb2dba264d1b7621c678..51a86a37a10c6aee5e893481eac3771033f877b5 100644 |
--- a/Source/core/css/resolver/ElementResolveContext.cpp |
+++ b/Source/core/css/resolver/ElementResolveContext.cpp |
@@ -32,14 +32,16 @@ namespace blink { |
ElementResolveContext::ElementResolveContext(const Document& document) |
: m_element(nullptr) |
, m_parentNode(nullptr) |
+ , m_parentStyle(nullptr) |
, m_rootElementStyle(document.documentElement() ? document.documentElement()->renderStyle() : document.renderStyle()) |
, m_elementLinkState(NotInsideLink) |
, m_distributedToInsertionPoint(false) |
{ |
} |
-ElementResolveContext::ElementResolveContext(Element& element) |
+ElementResolveContext::ElementResolveContext(Element& element, RenderStyle* parentStyle) |
: m_element(&element) |
+ , m_parentStyle(parentStyle) |
, m_elementLinkState(element.document().visitedLinkState().determineLinkState(element)) |
, m_distributedToInsertionPoint(false) |
{ |
@@ -53,6 +55,8 @@ ElementResolveContext::ElementResolveContext(Element& element) |
m_rootElementStyle = documentElement && element != documentElement ? documentElement->renderStyle() : documentStyle; |
if (!m_rootElementStyle) |
m_rootElementStyle = documentStyle; |
+ if (!m_parentStyle && m_parentNode) |
+ m_parentStyle = m_parentNode->renderStyle(); |
} |
} // namespace blink |