| Index: Source/web/PageScaleConstraintsSet.cpp
|
| diff --git a/Source/web/PageScaleConstraintsSet.cpp b/Source/web/PageScaleConstraintsSet.cpp
|
| index 582c27fce1427446acfd83a516d60c0ab7d01569..e40d6bce553eb29b08bad1fc51560c39c14bd797 100644
|
| --- a/Source/web/PageScaleConstraintsSet.cpp
|
| +++ b/Source/web/PageScaleConstraintsSet.cpp
|
| @@ -123,9 +123,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;
|
| @@ -140,6 +140,11 @@ void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescri
|
| if (resetInitialScale)
|
| m_pageDefinedConstraints.initialScale = 1.0f;
|
| }
|
| + if (nonUserScalableQuirkEnabled && !description.userZoom) {
|
| + m_pageDefinedConstraints.initialScale = 1.0f;
|
| + m_pageDefinedConstraints.minimumScale = 1.0f;
|
| + m_pageDefinedConstraints.maximumScale = 1.0f;
|
| + }
|
|
|
| float adjustedLayoutSizeWidth = m_pageDefinedConstraints.layoutSize.width();
|
| float targetDensityDPIFactor = 1.0f;
|
| @@ -155,12 +160,13 @@ void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescri
|
| }
|
|
|
| if (wideViewportQuirkEnabled) {
|
| - if (useWideViewport && (description.maxWidth.isAuto() || description.maxWidth.type() == ExtendToZoom) && description.zoom != 1.0f) {
|
| + const bool nonUserScalable = nonUserScalableQuirkEnabled && !description.userZoom;
|
| + if (useWideViewport && (description.maxWidth.isAuto() || description.maxWidth.type() == ExtendToZoom) && description.zoom != 1.0f && !nonUserScalable) {
|
| adjustedLayoutSizeWidth = layoutFallbackWidth;
|
| - } else if (!useWideViewport) {
|
| - const float nonWideScale = description.zoom < 1 && !description.maxWidth.isViewportPercentage() ? -1 : oldInitialScale;
|
| + } else if (!useWideViewport || (nonUserScalable && (description.maxWidth.isAuto() || description.maxWidth.type() == ExtendToZoom || !description.maxWidth.isFixed()))) {
|
| + const float nonWideScale = nonUserScalable || (description.zoom < 1 && !description.maxWidth.isViewportPercentage()) ? -1 : oldInitialScale;
|
| adjustedLayoutSizeWidth = getLayoutWidthForNonWideViewport(viewSize, nonWideScale) / targetDensityDPIFactor;
|
| - if (description.zoom < 1) {
|
| + if (nonUserScalable || description.zoom < 1) {
|
| m_pageDefinedConstraints.initialScale = targetDensityDPIFactor;
|
| m_pageDefinedConstraints.minimumScale = std::min<float>(m_pageDefinedConstraints.minimumScale, m_pageDefinedConstraints.initialScale);
|
| m_pageDefinedConstraints.maximumScale = std::max<float>(m_pageDefinedConstraints.maximumScale, m_pageDefinedConstraints.initialScale);
|
|
|