Bug 105497

Summary: [EFL][WK2] Optimize zooming and scrolling.
Product: WebKit Reporter: Dongseong Hwang <dongseong.hwang>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: d-r, joone, kenneth, laszlo.gombos, mcatanzaro, mikhail.pozdnyakov, ostap73, tonikitoo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 103105    

Description Dongseong Hwang 2012-12-19 22:00:04 PST
Qt can make fast scrolling and fast zooming. However, efl always make zooming and scrolling when receiving didRenderFrame mesage from Web Process. It makes big UI responsibility latency.
Refer to Bug 78602

In detail, PageViewportControllerClientQt calls movementStarted() and contentXChanged() if needed.

PageViewportControllerClientQt::PageViewportControllerClientQt(QQuickWebView* viewportItem, QQuickWebPage* pageItem)
    ...
{
    ...
    connect(m_viewportItem, SIGNAL(movementStarted()), SLOT(flickMoveStarted()), Qt::DirectConnection);
    connect(m_viewportItem, SIGNAL(movementEnded()), SLOT(flickMoveEnded()), Qt::DirectConnection);
    connect(m_viewportItem, SIGNAL(contentXChanged()), SLOT(pageItemPositionChanged()));
    connect(m_viewportItem, SIGNAL(contentYChanged()), SLOT(pageItemPositionChanged()));


    connect(m_scaleAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)),
            SLOT(scaleAnimationStateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
}

I does not have enough knowledge of efl UI toolkit framework. It is good if someone fix this bug before I study efl framework :)
Comment 1 Kenneth Rohde Christiansen 2012-12-21 06:53:56 PST
I don't understand this.

Currently EFL doesn't have a way to pinch and pan, so you can only scroll by selection text/images or by using the wheel. That then sends scroll requests to the UI side.

Could you explain better?
Comment 2 Dongseong Hwang 2012-12-25 18:14:41 PST
Currently, when EFL scrolls, EFL needs two message communications: request (UI Process -> Web Process) and response (Web Process -> UI Process).
However, we can speculatively scroll in UI side like Qt.

In detail, EFL runs following process for scrolling.

1. Request scrolling web process to ui process
- UI Process : WebPageProxy::scrollBy()
- Web Process : WebCore computes

2. Response scrolling
- Web Process : notify did scrolling
- UI Process : PageViewportController::pageDidRequestScroll is called.
-- Update scroll position of EwkView and request rendering of EwkView.

void PageViewportControllerClientEfl::setViewportPosition(const WebCore::FloatPoint& contentsPoint)
{
    m_contentPosition = contentsPoint;

    FloatPoint pos(contentsPoint);
    pos.scale(scaleFactor(), scaleFactor());
    m_viewImpl->setPagePosition(pos);

    m_controller->didChangeContentsVisibility(m_contentPosition, scaleFactor());
}

However, Qt can scroll in UI side. currently, Qt did when flicking.
When Qt view's scroll position is changed, flickMoveStarted(), pageItemPositionChanged() and flickMoveEnded() are called.
Three methods update windows with changed scoll position.

void PageViewportControllerClientQt::flickMoveStarted()
{
    m_controller->suspendContent();

    m_lastScrollPosition = m_viewportItem->contentPos();

    m_ignoreViewportChanges = false;
}

void PageViewportControllerClientQt::flickMoveEnded()
{
    // This method is called on the end of the pan or pan kinetic animation.

    m_ignoreViewportChanges = true;
    if (!m_isUserInteracting)
        m_controller->resumeContent();
}

void PageViewportControllerClientQt::pageItemPositionChanged()
{
    if (m_ignoreViewportChanges)
        return;

    QPointF newPosition = m_viewportItem->contentPos();

    updateViewportController(m_lastScrollPosition - newPosition);

    m_lastScrollPosition = newPosition;
}

I think if efl implemented fast scolling like qt, scrolling latency can be significantly reduced.
Comment 3 Kenneth Rohde Christiansen 2012-12-28 01:32:30 PST
Ah of course we will implement this. Btw, Qt also does the same as us for mouse wheel scrolls. Potentially that could also be done on UI side (with smoothing)
Comment 4 Michael Catanzaro 2017-03-11 10:49:23 PST
Closing this bug because the EFL port has been removed from trunk.

If you feel this bug applies to a different upstream WebKit port and was closed in error, please either update the title and reopen the bug, or leave a comment to request this.