Chromium Code Reviews| 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(); |