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

Unified Diff: Source/web/PageScaleConstraintsSet.cpp

Issue 53053002: [Android WebView] Add a legacy quirk for 'user-scalable=no' case (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rewritten according to aelias@' proposal 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
Index: Source/web/PageScaleConstraintsSet.cpp
diff --git a/Source/web/PageScaleConstraintsSet.cpp b/Source/web/PageScaleConstraintsSet.cpp
index 15f6e824d27c58167a67bcd1e952c71d0b2dc37d..963003e6593650a16a2fc43011257d312088ae42 100644
--- a/Source/web/PageScaleConstraintsSet.cpp
+++ b/Source/web/PageScaleConstraintsSet.cpp
@@ -129,9 +129,9 @@ static float getLayoutWidthForNonWideViewport(const FloatSize& deviceSize, float
return initialScale == -1 ? deviceSize.width() : deviceSize.width() / initialScale;
}
-void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescription& description, IntSize viewSize, int layoutFallbackWidth, float deviceScaleFactor, bool supportTargetDensityDPI, bool wideViewportQuirkEnabled, bool useWideViewport, bool loadWithOverviewMode)
+void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescription& description, IntSize viewSize, int layoutFallbackWidth, float deviceScaleFactor, bool supportTargetDensityDPI, bool wideViewportQuirkEnabled, bool useWideViewport, bool loadWithOverviewMode, bool nonUserScalableQuirkEnabled)
{
- if (!supportTargetDensityDPI && !wideViewportQuirkEnabled && loadWithOverviewMode)
+ if (!supportTargetDensityDPI && !wideViewportQuirkEnabled && loadWithOverviewMode && !nonUserScalableQuirkEnabled)
return;
const float oldInitialScale = m_pageDefinedConstraints.initialScale;
@@ -174,6 +174,17 @@ void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescri
}
}
+ if (nonUserScalableQuirkEnabled && !description.userZoom) {
+ m_pageDefinedConstraints.initialScale = targetDensityDPIFactor;
+ if (description.maxWidth.isAuto() || description.maxWidth.type() == ExtendToZoom || description.maxWidth == Length(100, ViewportPercentageWidth))
+ adjustedLayoutSizeWidth = viewSize.width() / targetDensityDPIFactor;
+ }
+
+ if (!description.userZoom) {
aelias_OOO_until_Jul13 2013/11/05 19:39:09 On second thought, let's also add "&& m_pageDefine
mnaganov (inactive) 2013/11/06 09:53:07 Done.
+ m_pageDefinedConstraints.minimumScale = m_pageDefinedConstraints.initialScale;
+ m_pageDefinedConstraints.maximumScale = m_pageDefinedConstraints.initialScale;
+ }
+
if (adjustedLayoutSizeWidth != m_pageDefinedConstraints.layoutSize.width()) {
ASSERT(m_pageDefinedConstraints.layoutSize.width() > 0);
float adjustedLayoutSizeHeight = (adjustedLayoutSizeWidth * m_pageDefinedConstraints.layoutSize.height()) / m_pageDefinedConstraints.layoutSize.width();

Powered by Google App Engine
This is Rietveld 408576698