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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 23742003: Use css-device-adapt constraining for legacy viewport tags. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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 bcfa7c3158c8ce8494405d14230a87912344b255..88c74b1cf20c4301ab0e243559783eba182dd26a 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -3015,9 +3015,13 @@ void WebViewImpl::updatePageDefinedPageScaleConstraints(const ViewportArguments&
return;
ViewportArguments adjustedArguments = arguments;
- if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedArguments.type == ViewportArguments::ViewportMeta)
- adjustedArguments.type = ViewportArguments::ViewportMetaLayoutSizeQuirk;
- m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedArguments, m_size, page()->settings().layoutFallbackWidth());
+ if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedArguments.type == ViewportArguments::ViewportMeta) {
+ if (adjustedArguments.maxWidth == ViewportArguments::ValueExtendToZoom)
+ adjustedArguments.maxWidth = ViewportArguments::ValueAuto;
+ adjustedArguments.minWidth = adjustedArguments.maxWidth;
+ adjustedArguments.minHeight = adjustedArguments.maxHeight;
+ }
+ m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedArguments, m_size);
if (settingsImpl()->supportDeprecatedTargetDensityDPI())
m_pageScaleConstraintsSet.adjustPageDefinedConstraintsForAndroidWebView(adjustedArguments, m_size, page()->settings().layoutFallbackWidth(), deviceScaleFactor(), page()->settings().useWideViewport(), page()->settings().loadWithOverviewMode());
@@ -4129,7 +4133,7 @@ void WebViewImpl::pointerLockMouseEvent(const WebInputEvent& event)
bool WebViewImpl::shouldDisableDesktopWorkarounds()
{
ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewportArguments();
- return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments.userZoom
+ return arguments.maxWidth == ViewportArguments::ValueDeviceWidth || !arguments.userZoom
|| (arguments.minZoom == arguments.maxZoom && arguments.minZoom != ViewportArguments::ValueAuto);
}

Powered by Google App Engine
This is Rietveld 408576698