Index: Source/core/dom/Document.cpp |
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
index 3dd1542c1a7130b26fa4b2fb4262e8053ecc699d..febbc80187dac8e3628008f5bb73e9542469cfc8 100644 |
--- a/Source/core/dom/Document.cpp |
+++ b/Source/core/dom/Document.cpp |
@@ -1746,8 +1746,14 @@ void Document::updateLayoutTree(StyleRecalcChange change) |
// re-attaching our containing iframe, which when asked HTMLFrameElementBase::isURLAllowed |
// hits a null-dereference due to security code always assuming the document has a SecurityOrigin. |
- if (m_elemSheet && m_elemSheet->contents()->usesRemUnits()) |
- styleEngine().setUsesRemUnit(true); |
+ if (m_elemSheet) { |
+ if (m_elemSheet->contents()->usesRemUnits()) |
+ styleEngine().setUsesRemUnit(true); |
+ if (m_elemSheet->contents()->usesVariables()) { |
+ ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); |
+ styleEngine().setUsesVariables(true); |
+ } |
+ } |
updateStyle(change); |
@@ -2877,6 +2883,7 @@ void Document::updateBaseURL() |
m_elemSheet = CSSStyleSheet::createInline(this, m_baseURL); |
// FIXME: So we are not really the parser. The right fix is to eliminate the element sheet completely. |
m_elemSheet->contents()->parserSetUsesRemUnits(usesRemUnits); |
+ m_elemSheet->contents()->parserSetUsesVariables(m_elemSheet->contents()->usesVariables()); |
} |
if (!equalIgnoringFragmentIdentifier(oldBaseURL, m_baseURL)) { |