Chromium Code Reviews| Index: Source/web/PageScaleConstraintsSet.cpp |
| diff --git a/Source/web/PageScaleConstraintsSet.cpp b/Source/web/PageScaleConstraintsSet.cpp |
| index d319e00d5e2abd1c55a21d9fd49a115894655665..19ec04f6ac08cdb2a99027f092f9b1d67b3efdc6 100644 |
| --- a/Source/web/PageScaleConstraintsSet.cpp |
| +++ b/Source/web/PageScaleConstraintsSet.cpp |
| @@ -134,9 +134,9 @@ static float computeHeightByAspectRatio(float width, const FloatSize& deviceSize |
| return width * (deviceSize.height() / deviceSize.width()); |
| } |
| -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; |
| @@ -184,6 +184,16 @@ void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescri |
| } |
| } |
| + if (nonUserScalableQuirkEnabled && !description.userZoom) { |
| + m_pageDefinedConstraints.initialScale = targetDensityDPIFactor; |
| + m_pageDefinedConstraints.minimumScale = m_pageDefinedConstraints.initialScale; |
|
aelias_OOO_until_Jul13
2013/11/06 20:45:25
Hmm, I don't think this should've been moved here
|
| + m_pageDefinedConstraints.maximumScale = m_pageDefinedConstraints.initialScale; |
| + if (description.maxWidth.isAuto() || description.maxWidth.type() == ExtendToZoom || description.maxWidth == Length(100, ViewportPercentageWidth)) { |
| + adjustedLayoutSizeWidth = viewSize.width() / targetDensityDPIFactor; |
| + adjustedLayoutSizeHeight = computeHeightByAspectRatio(adjustedLayoutSizeWidth, viewSize); |
| + } |
| + } |
| + |
| m_pageDefinedConstraints.layoutSize.setWidth(adjustedLayoutSizeWidth); |
| m_pageDefinedConstraints.layoutSize.setHeight(adjustedLayoutSizeHeight); |
| } |