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

Unified Diff: Source/core/dom/Document.cpp

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ToT-ed again... Created 5 years, 5 months 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/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)) {

Powered by Google App Engine
This is Rietveld 408576698