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

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

Issue 13771002: Recalc styles on resize if we have viewport units. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 8 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/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

Powered by Google App Engine
This is Rietveld 408576698