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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 1787913002: Clear page-defined constraints when viewportEnabled setting becomes false. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nit Created 4 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 6e4f66214a0ab35397835f667f938b626b76f329..c95ff4cfa344853cc5ae7c593179ea79f0fd582b 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -3310,9 +3310,15 @@ void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription
m_layerTreeView->heuristicsForGpuRasterizationUpdated(m_matchesHeuristicsForGpuRasterization);
}
- if (!settings()->viewportEnabled() || !page() || (!m_size.width && !m_size.height) || !page()->mainFrame()->isLocalFrame())
+ if (!page() || (!m_size.width && !m_size.height) || !page()->mainFrame()->isLocalFrame())
return;
+ if (!settings()->viewportEnabled()) {
+ pageScaleConstraintsSet().clearPageDefinedConstraints();
+ updateMainFrameLayoutSize();
+ return;
+ }
+
Document* document = page()->deprecatedLocalMainFrame()->document();
m_matchesHeuristicsForGpuRasterization = description.matchesHeuristicsForGpuRasterization();
@@ -3413,18 +3419,6 @@ WebSize WebViewImpl::contentsPreferredMinimumSize()
return IntSize(widthScaled, heightScaled);
}
-void WebViewImpl::enableViewport()
-{
- settings()->setViewportEnabled(true);
-}
-
-void WebViewImpl::disableViewport()
-{
- settings()->setViewportEnabled(false);
- pageScaleConstraintsSet().clearPageDefinedConstraints();
- updateMainFrameLayoutSize();
-}
-
float WebViewImpl::defaultMinimumPageScaleFactor() const
{
return pageScaleConstraintsSet().defaultConstraints().minimumScale;
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698