ScrollPoint is not coming properly in page reload.
authordeepak <deepak.m1@samsung.com>
Thu, 20 Jun 2013 23:49:04 +0000 (05:19 +0530)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Mon, 21 Oct 2013 05:13:36 +0000 (05:13 +0000)
[Version]    N/A
[Project]    Redwood
[Title]      Reload On the Page after scroll should not comes to the start position.
[BinType]    N/A
[Customer]   HQ
[Issue#]     WEB-3334
[Problem]    ScrollPosition are getting set to 0,0
[Cause]      setVisibleContent() from initializeVisibleContentRect() in PageClientImpl.cpp is setting m_visibleContectRect to 0,0
[Solution]   code added to restore scroll position that will frame load notification come.
[Team]       WebCoreSupport
[Developer]  deepak.m1@samsung.com
[Request]    N/A
[Horizontal expansion] N/A
[SCMRequest] NA

Change-Id: I2ace399f2546cb0fe0107eb7f4621c5a899845d7

Source/WTF/wtf/Platform.h
Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp
Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/efl/PageClientImpl.h

index 77ff4ee..06be5b6 100755 (executable)
@@ -687,6 +687,7 @@ com) : Patch to do not adjust cover rect as fixed pixel size*/
 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
 #define ENABLE_TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT 1 /* Changhyup Jwa(ch.jwa@samsung.com) : Restore visible content rect on going back and forward */
 #define ENABLE_TIZEN_WEBKIT2_BEFORE_PAGE_RENDERED_SCROLL_POSITION 1 /*Santosh Mahto(santosh.ma@samsung.com) : save and restore  the scrollpostion before page is not rendered fully. */
+#define ENABLE_TIZEN_WEBKIT2_RESTORE_SCROLLPOINT_ON_FRAME_LOAD_FINISH 1 /*Deepak Mittal(deepak.m1@samsung.com) : restoring scroll points on FrameLoadFinish. */
 #endif
 #define ENABLE_TIZEN_WEBKIT2_MEMORY_SAVING_MODE 1 /*Eunsol Park(eunsol47.park@samsung.com) : Used for lower memory usage profiling*/
 #define ENABLE_TIZEN_WEBKIT2_CONTEXT_X_WINDOW 1 /* Changhyup Jwa(ch.jwa@samsung.com) : WebProcess cannot access to evas, so it needs to obtain window id to get window's orientation. Default root window has sync issue. */
index ac69478..49d12fb 100755 (executable)
@@ -551,6 +551,10 @@ void EwkViewImpl::informLoadFinished()
     if (pageClient->wasViewportFitsToContent() && !pageClient->viewportConstraints().fixedInitialScale)
         pageClient->fitViewportToContent();
 
+#if ENABLE(TIZEN_WEBKIT2_RESTORE_SCROLLPOINT_ON_FRAME_LOAD_FINISH)
+    pageClient->setRestoredScrollPoints();
+#endif
+
 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
     ewk_view_form_password_data_fill(m_view);
 #endif
index 760b834..fd0dade 100755 (executable)
@@ -95,6 +95,7 @@ PageClientImpl::PageClientImpl(EwkViewImpl* viewImpl)
 #endif
 #if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
     , m_restoredScaleFactor(0)
+    , m_restoredScrollPosition(IntPoint())
 #endif
 #if ENABLE(TIZEN_WEBKIT2_BEFORE_PAGE_RENDERED_SCROLL_POSITION)
     , m_scrollPositionBeforePageRendered(IntPoint())
@@ -276,9 +277,6 @@ void PageClientImpl::initializeVisibleContentRect()
         initialScrollPosition = m_restoredScrollPosition;
         initialScaleFactor = m_restoredScaleFactor;
     }
-#if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
-    m_restoredScaleFactor = 0;
-#endif
 #if ENABLE(TIZEN_DLOG_SUPPORT)
     TIZEN_LOGI("visibleContentRect: [%d, %d, %d, %d], scale factor: [%.2f]",
         initialScrollPosition.x(), initialScrollPosition.y(),
@@ -301,6 +299,17 @@ double PageClientImpl::availableMinimumScale()
     return horizontalMinScale;
 }
 
+#if ENABLE(TIZEN_WEBKIT2_RESTORE_SCROLLPOINT_ON_FRAME_LOAD_FINISH)
+void PageClientImpl::setRestoredScrollPoints()
+{
+    if(m_restoredScaleFactor)
+        setVisibleContentRect(IntRect(m_restoredScrollPosition, m_visibleContentRect.size()), m_restoredScaleFactor);
+    m_restoredScaleFactor = 0;
+    m_restoredScrollPosition = IntPoint();
+    displayViewport();
+}
+#endif
+
 void PageClientImpl::fitViewportToContent()
 {
 #if ENABLE(TIZEN_DLOG_SUPPORT)
index 4c04653..5690d24 100755 (executable)
@@ -119,6 +119,9 @@ public:
     TIZEN_VIRTUAL void updateVisibleContentRectSize(const WebCore::IntSize&);
 #endif
     void prepareRestoredVisibleContectRect();
+#if ENABLE(TIZEN_WEBKIT2_RESTORE_SCROLLPOINT_ON_FRAME_LOAD_FINISH)
+    void setRestoredScrollPoints();
+#endif
     void initializeVisibleContentRect();
     double availableMinimumScale();
     void fitViewportToContent();