void PageClientImpl::updateScale()
{
+ double newScale = scaleFactor();
if (m_layoutAndScaleState == BeforeCommitLoad) {
// Before commit load, we don't need to update visible content rect.
// ex) While we navigate from m.mt.co.kr to www.mt.co.kr(desktop),
// m_visibleContentRect.location should be set to (0, 0).
// If location is not (0, 0), user scrolled flag is set to TRUE by calling setVisibleContentRect().
m_visibleContentRect.setLocation(IntPoint(0, 0));
+ newScale = m_viewportConstraints.initialScale;
+ } else {
+ // if current scale factor exceeds changed viewport constraints' scale range,
+ // re-initialize scale factor with initial scale factor.
+ double adjustedScale = adjustScaleWithViewport(newScale);
+ if (adjustedScale != newScale)
+ newScale = m_viewportConstraints.initialScale;
}
// We should update scale factor and scroll position even they are not changed.
// Because, contents size can be changed smaller by IME and visible content rect can be outside of contents boundary.
#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
- setVisibleContentRect(scrollPosition(), m_viewportConstraints.initialScale, FloatPoint());
+ setVisibleContentRect(scrollPosition(), newScale, FloatPoint());
#else
- m_page->scalePage(m_viewportConstraints.initialScale, m_page->scrollPosition());
+ m_page->scalePage(newScale, scrollPosition());
#endif
}
void PageClientImpl::didChangeViewportProperties(const WebCore::ViewportAttributes& attributes)
{
m_viewportConstraints = computeViewportConstraints(attributes);
- updateScale();
+ if (!ewk_view_focused_node_adjust(m_viewWidget))
+ updateScale();
#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
updateTextSelectionHandlesAndContextMenu(true);
void PageClientImpl::didChangeContentsSize(const WebCore::IntSize size)
{
+ if (size.isEmpty())
+ return;
+
#if ENABLE(TIZEN_WEBKIT2_TILED_SCROLLBAR)
IntSize scaledSize = size;
scaledSize.scale(scaleFactor());
// If contents width exceeds viewport layout width and content is userScalable,
// update minimumScale.
- if (m_viewportConstraints.userScalable && previousMinimumScale > minimumScaleByContentWidth)
+ if (m_viewportConstraints.userScalable)
m_viewportConstraints.minimumScale = minimumScaleByContentWidth;
- // If scale factor was minimized, then minimize new scale factor too.
+ // If input field zoom worked, we don't need to update current scale factor anymore.
+ if (ewk_view_focused_node_adjust(m_viewWidget))
+ return;
+
+ // If current scale factor was minimized, minimize new scale factor
double newScaleFactor = scaleFactor();
if (scaleFactor() == previousMinimumScale && m_viewportConstraints.userScalable && !defaultViewLevel)
newScaleFactor = m_viewportConstraints.minimumScale;
+
#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
- setVisibleContentRect(m_page->scrollPosition(), newScaleFactor, FloatPoint());
+ setVisibleContentRect(scrollPosition(), newScaleFactor, FloatPoint());
#else
m_page->scalePage(newScaleFactor, scrollPosition());
#endif
// ex) During the navigation from http://m.mt.co.kr/new/ to http://www.mt.co.kr(desktop)
suspendPainting();
m_layoutAndScaleState = DidCommitLoaded;
+ m_visibleContentRect.setLocation(IntPoint(0, 0));
}
return;
#endif