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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 55073002: [Android WebView] Add a quirk to clobber initial scale in certain cases (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed checking against device-width Created 7 years, 1 month 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 | « Source/web/WebSettingsImpl.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 16706ac9b2da5cbaaa665b26de0d00df7f2d03ab..09ae305e3ac032e70c58adaef7a52f52c9378375 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -3005,6 +3005,14 @@ void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription
}
float oldInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().initialScale;
m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedDescription, m_size);
+
+ if (settingsImpl()->clobberUserAgentInitialScaleQuirk()
+ && m_pageScaleConstraintsSet.userAgentConstraints().initialScale != -1
+ && m_pageScaleConstraintsSet.userAgentConstraints().initialScale * deviceScaleFactor() <= 1) {
+ if (!description.maxWidth.isFixed()
+ || (description.maxWidth == Length(100, ViewportPercentageWidth) && m_pageScaleConstraintsSet.pageDefinedConstraints().initialScale == 1.0f))
+ setInitialPageScaleOverride(-1);
+ }
m_pageScaleConstraintsSet.adjustForAndroidWebViewQuirks(adjustedDescription, m_size, page()->settings().layoutFallbackWidth(), deviceScaleFactor(), settingsImpl()->supportDeprecatedTargetDensityDPI(), page()->settings().wideViewportQuirkEnabled(), page()->settings().useWideViewport(), page()->settings().loadWithOverviewMode());
float newInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().initialScale;
if (oldInitialScale != newInitialScale && newInitialScale != -1) {
« no previous file with comments | « Source/web/WebSettingsImpl.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698