drawingArea()->layerTreeHostProxy()->setContentsSize(WebCore::FloatSize(size.width(), size.height()));
#endif
- // If scale factor was fitted to content's width, then minimize new scale factor too.
+ // FIXME: Currently minimum scale is recalculated by contents' width
+ // if contents' width exceeds viewport layout width and userScalable is true.
+ // But we should recalculate this when viewport argument's minimum scale is not fixed.
double previousMinimumScale = m_viewportConstraints.minimumScale;
+ double minimumScaleByContentWidth = (double)viewSize().width() / size.width();
+ double defaultViewLevel = m_page->pageGroup()->preferences()->defaultViewLevel();
+
+ // If contents width exceeds viewport layout width and content is userScalable,
+ // update minimumScale.
+ if (m_viewportConstraints.userScalable && previousMinimumScale > minimumScaleByContentWidth)
+ m_viewportConstraints.minimumScale = minimumScaleByContentWidth;
- // If contents width exceeds viewport layout width, update minimumScale.
- m_viewportConstraints.minimumScale = (float)viewSize().width() / size.width();
+ // If scale factor was minimized, then minimize new scale factor too.
+ double newScaleFactor = scaleFactor();
+ if (scaleFactor() == previousMinimumScale && m_viewportConstraints.userScalable && !defaultViewLevel)
+ newScaleFactor = m_viewportConstraints.minimumScale;
#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
- if (scaleFactor() == previousMinimumScale)
- setVisibleContentRect(scrollPosition(), m_viewportConstraints.minimumScale, FloatPoint());
- else
- setVisibleContentRect(scrollPosition(), scaleFactor(), FloatPoint());
+ setVisibleContentRect(m_page->scrollPosition(), newScaleFactor, FloatPoint());
#else
- if (m_requestedScaleFactor == previousMinimumScale)
- m_page->scalePage(m_viewportConstraints.minimumScale, scrollPosition());
+ m_page->scalePage(newScaleFactor, scrollPosition());
#endif
// After contents size is changed, update scroll bar.
displayViewport();