constraints.maximumScale = attributes.maximumScale * attributes.devicePixelRatio;
constraints.userScalable = attributes.userScalable;
constraints.layoutSize = attributes.layoutSize;
+ constraints.contentsDefinedInitialScale = (ViewportArguments::ValueAuto != attributes.initialScale);
double defaultViewLevel = m_page->pageGroup()->preferences()->defaultViewLevel();
// If defaultViewLevel is 1, "Default View" is set as "Readable"
if (m_viewportConstraints.userScalable
&& fabs(oldMinimumScale - newMinimumScale) > numeric_limits<float>::epsilon()) {
// Sometimes initializeVisibleContentRect can be called after content size change.
- // So, if initialScale is same to minimumScale, update initialScale too.
- if (fabs(m_viewportConstraints.initialScale - oldMinimumScale) < numeric_limits<float>::epsilon())
+ // So, if initialScale is not set explicitly in content's meta viewport tag and is same to minimumScale, update initialScale too.
+ if (!m_viewportConstraints.contentsDefinedInitialScale
+ && fabs(m_viewportConstraints.initialScale - oldMinimumScale) < numeric_limits<float>::epsilon())
m_viewportConstraints.initialScale = newMinimumScale;
m_viewportConstraints.minimumScale = newMinimumScale;
}
, minimumScale(0.25)
, maximumScale(5.0)
, userScalable(true)
+ , contentsDefinedInitialScale(false)
, layoutSize(WebCore::IntSize())
{
}
double minimumScale;
double maximumScale;
bool userScalable;
+ bool contentsDefinedInitialScale;
WebCore::IntSize layoutSize;
};