Fixed the problem that the screen is moved to the initial position when page was...
authorbunam.jeon <bunam.jeon@samsung.com>
Mon, 17 Jun 2013 10:29:03 +0000 (19:29 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Mon, 24 Jun 2013 15:22:17 +0000 (15:22 +0000)
[Title] Fixed the problem that the screen is moved to the initial position when page was refreshed.
[Issue#] N/A
[Problem] The screen is moved to the initial position when page was refreshed.
[Cause] Coordinates for the restoration of the screen will not be saved.
[Solution] Modified to save the screen coordinates when ewk_view_reload.

Change-Id: I86825326d5d2afe2581b8c132a50de9568b7f053

Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/efl/PageClientImpl.h
Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/UIProcess/PageClient.h

index 895bf23..4cc6b20 100755 (executable)
@@ -194,6 +194,12 @@ void PageClientImpl::updateViewportSize(const IntSize& viewportSize, const int a
 }
 #endif
 
+void PageClientImpl::prepareRestoredVisibleContectRect()
+{
+    m_restoredScaleFactor = scaleFactor();
+    m_restoredScrollPosition = scrollPosition();
+}
+
 void PageClientImpl::initializeVisibleContentRect()
 {
     _ewk_view_resume_painting(m_viewImpl->view());
@@ -208,6 +214,9 @@ void PageClientImpl::initializeVisibleContentRect()
         initialScrollPosition = m_restoredScrollPosition;
         initialScaleFactor = m_restoredScaleFactor;
     }
+#if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
+    m_restoredScaleFactor = 0;
+#endif
 #endif
     setVisibleContentRect(IntRect(initialScrollPosition, m_visibleContentRect.size()), initialScaleFactor);
 #else
@@ -675,9 +684,6 @@ void PageClientImpl::didCommitLoadForMainFrame(bool)
 #if OS(TIZEN)
     m_pageDidRendered = false;
     m_viewportFitsToContent = false;
-#if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
-    m_restoredScaleFactor = 0;
-#endif
     return;
 #endif
     notImplemented();
index e0ddf58..6d67b6d 100755 (executable)
@@ -114,6 +114,7 @@ public:
 #if USE(TILED_BACKING_STORE) && ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
     TIZEN_VIRTUAL void updateViewportSize(const WebCore::IntSize&, const int);
 #endif
+    void prepareRestoredVisibleContectRect();
     void initializeVisibleContentRect();
     double availableMinimumScale();
     void fitViewportToContent();
index f9377ae..4772fef 100644 (file)
@@ -1399,6 +1399,7 @@ Eina_Bool ewk_view_reload(Evas_Object* ewkView)
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
     EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
 
+    impl->pageClient->prepareRestoredVisibleContectRect();
     impl->pageProxy->reload(/*reloadFromOrigin*/ false);
     impl->informURLChange();
 
index f9cefd0..1db73a3 100755 (executable)
@@ -119,6 +119,7 @@ public:
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
+    virtual void prepareRestoredVisibleContectRect() = 0;
     virtual void pageDidRequestRestoreVisibleContentRect(const WebCore::IntPoint&, float) = 0;
 #endif