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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 382543003: Add a force-layout-height-to-zero layout mode to WebViewImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index f4e161c00ad670a1bc8f27728e1f3aa15c9dd9c8..036383b759489cc719371eac9473b02b55ac487a 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -360,6 +360,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_spellCheckerClientImpl(this)
, m_storageClientImpl(this)
, m_fixedLayoutSizeLock(false)
+ , m_forceZeroLayoutHeight(false)
, m_shouldAutoResize(false)
, m_zoomLevel(0)
, m_minimumZoomLevel(zoomFactorToZoomLevel(minTextSizeMultiplier))
@@ -3049,6 +3050,9 @@ void WebViewImpl::updateMainFrameLayoutSize()
}
}
+ if (m_forceZeroLayoutHeight)
+ layoutSize.height = 0;
+
view->setLayoutSize(layoutSize);
}
@@ -3106,6 +3110,15 @@ void WebViewImpl::resetScrollAndScaleState()
view->cacheCurrentScrollPosition();
}
+void WebViewImpl::setForceZeroLayoutHeight(bool enable)
+{
+ if (m_forceZeroLayoutHeight == enable)
+ return;
+
+ m_forceZeroLayoutHeight = enable;
+ updateMainFrameLayoutSize();
+}
+
void WebViewImpl::setFixedLayoutSize(const WebSize& layoutSize)
{
if (!page() || !page()->mainFrame()->isLocalFrame())

Powered by Google App Engine
This is Rietveld 408576698