Index: Source/WebCore/dom/Document.cpp |
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp |
index 1fdd8fb6682bd0a39ff8bc57e846eb4775424b3b..57f6c4653ef8951887cd03d9076acf0839b5ff2c 100644 |
--- a/Source/WebCore/dom/Document.cpp |
+++ b/Source/WebCore/dom/Document.cpp |
@@ -1810,6 +1810,9 @@ void Document::recalcStyle(StyleChange change) |
if (m_elemSheet && m_elemSheet->contents()->usesRemUnits()) |
m_styleSheetCollection->setUsesRemUnit(true); |
+ if (m_elemSheet && m_elemSheet->contents()->usesViewportUnits()) |
+ m_styleSheetCollection->setUsesViewportUnit(true); |
+ |
m_inStyleRecalc = true; |
{ |
PostAttachCallbackDisabler disabler(this); |
@@ -2667,6 +2670,9 @@ 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); |
+ |
+ bool usesViewportUnits = m_elemSheet->contents()->usesViewportUnits(); |
+ m_elemSheet->contents()->parserSetUsesViewportUnits(usesViewportUnits); |
} |
if (!equalIgnoringFragmentIdentifier(oldBaseURL, m_baseURL)) { |
@@ -4449,6 +4455,9 @@ void Document::finishedParsing() |
if (!m_documentTiming.domContentLoadedEventEnd) |
m_documentTiming.domContentLoadedEventEnd = monotonicallyIncreasingTime(); |
+ if (m_elemSheet && m_elemSheet->contents()->usesViewportUnits()) |
+ m_styleSheetCollection->setUsesViewportUnit(true); |
+ |
if (RefPtr<Frame> f = frame()) { |
// FrameLoader::finishedParsing() might end up calling Document::implicitClose() if all |
// resource loads are complete. HTMLObjectElements can start loading their resources from |