Changeset 168458 in webkit


Ignore:
Timestamp:
May 7, 2014 6:42:17 PM (10 years ago)
Author:
gyuyoung.kim@samsung.com
Message:

[CoordinatedGraphics][WK2] Scale factor and scroll position is not being restored properly in a back/forward load
https://bugs.webkit.org/show_bug.cgi?id=126022

Reviewed by Benjamin Poulain.

Original author : Thiago de Barros Lacerda, and finished by Gyuyoung Kim.

Source/WebCore:
When user is navigating back/forward to a page that has been scrolled and/or scaled, that page must be shown
with its last scroll position and scale factor. However, when fixed layout was enabled with CoordinatedGraphics
and TILED_BACKING_STORE, Page::setPageScaleFactor() doesn't send previous scroll position since r165652 and r165913.

This patch allows the Page::setPageScaleFactor() send stored position to WK2 implementation by calling delegatedScrollRequested()
directly when delegatesScrolling() is on.

  • page/Page.cpp:

(WebCore::Page::setPageScaleFactor): TILED_BACKING_STORE and delegateScrolling are enabled, we pass new scroll position to WK2 though
delegateScrolling is disabled.

  • platform/ScrollView.cpp: delegatedScrollRequested() call is moved from ScrollView::setScrollPosition() to Page::setPageScaleFactor().

(WebCore::ScrollView::setScrollPosition):

Source/WebKit2:
When user is navigating back/forward to a page that has been scrolled and/or scaled, that page must be shown
with its last scroll position and scale factor. However, when fixed layout was enabled with CoordinatedGraphics
and TILED_BACKING_STORE, Page::setPageScaleFactor() doesn't send previous scroll position since r165652 and r165913.

This patch allows the Page::setPageScaleFactor() send stored position to WK2 implementation.

  • UIProcess/CoordinatedGraphics/WebView.cpp:

(WebKit::WebView::didCommitLoadForMainFrame):

Tools:
Added an unit test case to check if scroll position and scale are restored properly.

  • TestWebKitAPI/PlatformEfl.cmake:
  • TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewRestoreZoomAndScrollBackForward.cpp: Added.

(TestWebKitAPI::didFinishLoadForFrame):
(TestWebKitAPI::didChangeContentsPosition):
(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/backforward1.html: Added.
  • TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/backforward2.html: Added.
Location:
trunk
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r168457 r168458  
     12014-05-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        [CoordinatedGraphics][WK2] Scale factor and scroll position is not being restored properly in a back/forward load
     4        https://bugs.webkit.org/show_bug.cgi?id=126022
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        Original author : Thiago de Barros Lacerda, and finished by Gyuyoung Kim.
     9
     10        When user is navigating back/forward to a page that has been scrolled and/or scaled, that page must be shown
     11        with its last scroll position and scale factor. However, when fixed layout was enabled with CoordinatedGraphics
     12        and TILED_BACKING_STORE, Page::setPageScaleFactor() doesn't send previous scroll position since r165652 and r165913.
     13
     14        This patch allows the Page::setPageScaleFactor() send stored position to WK2 implementation by calling delegatedScrollRequested()
     15        directly when delegatesScrolling() is on.
     16
     17        * page/Page.cpp:
     18        (WebCore::Page::setPageScaleFactor): TILED_BACKING_STORE and delegateScrolling are enabled, we pass new scroll position to WK2 though
     19        delegateScrolling is disabled.
     20        * platform/ScrollView.cpp: delegatedScrollRequested() call is moved from ScrollView::setScrollPosition() to Page::setPageScaleFactor().
     21        (WebCore::ScrollView::setScrollPosition):
     22
    1232014-05-07  Dean Jackson  <dino@apple.com>
    224
  • trunk/Source/WebCore/page/Page.cpp

    r168085 r168458  
    720720            if (!view->delegatesScrolling())
    721721                view->setScrollPosition(origin);
     722#if USE(TILED_BACKING_STORE)
     723            else
     724                view->hostWindow()->delegatedScrollRequested(origin);
     725#endif
    722726        }
    723727        return;
     
    747751        if (!view->delegatesScrolling())
    748752            view->setScrollPosition(origin);
     753#if USE(TILED_BACKING_STORE)
     754        else
     755            view->hostWindow()->delegatedScrollRequested(origin);
     756#endif
    749757    }
    750758
  • trunk/Source/WebCore/platform/ScrollView.cpp

    r168447 r168458  
    498498    }
    499499
    500 #if USE(TILED_BACKING_STORE)
    501     if (delegatesScrolling()) {
    502         hostWindow()->delegatedScrollRequested(scrollPoint);
    503         return;
    504     }
    505 #endif
    506 
    507500    IntPoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint);
    508501
  • trunk/Source/WebKit2/ChangeLog

    r168456 r168458  
     12014-05-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        [CoordinatedGraphics][WK2] Scale factor and scroll position is not being restored properly in a back/forward load
     4        https://bugs.webkit.org/show_bug.cgi?id=126022
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        Original author : Thiago de Barros Lacerda, and finished by Gyuyoung Kim.
     9
     10        When user is navigating back/forward to a page that has been scrolled and/or scaled, that page must be shown
     11        with its last scroll position and scale factor. However, when fixed layout was enabled with CoordinatedGraphics
     12        and TILED_BACKING_STORE, Page::setPageScaleFactor() doesn't send previous scroll position since r165652 and r165913.
     13
     14        This patch allows the Page::setPageScaleFactor() send stored position to WK2 implementation.
     15
     16        * UIProcess/CoordinatedGraphics/WebView.cpp:
     17        (WebKit::WebView::didCommitLoadForMainFrame):
     18
    1192014-05-07  Simon Fraser  <simon.fraser@apple.com>
    220
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp

    r167262 r168458  
    373373void WebView::didCommitLoadForMainFrame(const String&, bool)
    374374{
     375    setContentPosition(WebCore::FloatPoint());
    375376    m_contentsSize = IntSize();
    376377}
  • trunk/Tools/ChangeLog

    r168434 r168458  
     12014-05-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        [CoordinatedGraphics][WK2] Scale factor and scroll position is not being restored properly in a back/forward load
     4        https://bugs.webkit.org/show_bug.cgi?id=126022
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        Original author : Thiago de Barros Lacerda, and finished by Gyuyoung Kim.
     9
     10        Added an unit test case to check if scroll position and scale are restored properly.
     11
     12        * TestWebKitAPI/PlatformEfl.cmake:
     13        * TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewRestoreZoomAndScrollBackForward.cpp: Added.
     14        (TestWebKitAPI::didFinishLoadForFrame):
     15        (TestWebKitAPI::didChangeContentsPosition):
     16        (TestWebKitAPI::TEST):
     17        * TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/backforward1.html: Added.
     18        * TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/backforward2.html: Added.
     19
    1202014-05-07  Simon Fraser  <simon.fraser@apple.com>
    221
  • trunk/Tools/TestWebKitAPI/PlatformEfl.cmake

    r161524 r168458  
    9999    WillSendSubmitEvent
    100100    CoordinatedGraphics/WKViewIsActiveSetIsActive
     101    CoordinatedGraphics/WKViewRestoreZoomAndScrollBackForward
    101102    CoordinatedGraphics/WKViewUserViewportToContents
    102103    efl/WKViewClientWebProcessCallbacks
Note: See TracChangeset for help on using the changeset viewer.