[CoordinatedGraphics][WK2] Scale factor and scroll position is not being restored...
authorgyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 May 2014 01:42:17 +0000 (01:42 +0000)
committergyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 May 2014 01:42:17 +0000 (01:42 +0000)
commit3822b9efed40e73e72222eeaa8853293fbbab647
tree34e3bf14549b6aeacbc69494a1675cc5e3dc2170
parentb9c7f202f0a744d764bb1efa7b61824f6b7cf210
[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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168458 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/Page.cpp
Source/WebCore/platform/ScrollView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/PlatformEfl.cmake
Tools/TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewRestoreZoomAndScrollBackForward.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/backforward1.html [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/backforward2.html [new file with mode: 0644]