Fix invalid position when loading new page from clicking the link
authorTaeyun An <ty.an@samsung.com>
Sat, 8 Jun 2013 10:38:59 +0000 (19:38 +0900)
committerTaeyun An <ty.an@samsung.com>
Sat, 8 Jun 2013 10:38:59 +0000 (19:38 +0900)
[Title] Fix invalid position when loading new page from clicking the link
[Issue#] P130605-5873, P130523-2961
[Problem] The scroll position is not top when loading new page from link
[Cause] The previsou scroll position was set for new page
[Solution] Reset the scroll position for new page

Change-Id: I0906a988166847c10e5523bcd2c121b5b418812d

Source/WTF/wtf/Platform.h
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

index ecc7352..414f32e 100755 (executable)
@@ -673,6 +673,7 @@ com) : Patch to do not adjust cover rect as fixed pixel size*/
 #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. */
 #define ENABLE_TIZEN_WEBKIT2_FOR_MOVING_TEXT_SELECTION_HANDLE_FROM_OSP 1 /* Yuni Jeong(yhnet.jung@samsung.com) : Patchs for moving text selection handle from OSP */
+#define ENABLE_TIZEN_WEBKIT2_FIX_INVAlID_SCROLL_FOR_NEW_PAGE 1 /* Jongseok Yang (js45.yang@samsung.com) : Patch to fix the invalid scroll position by open source patch */
 #endif /* ENABLE(TIZEN_WEBKIT2) */
 
 /* When displaying menu list using menu icon, a additional scrollbar is displayed in the screen center
index 9aabda5..9ad4c86 100755 (executable)
@@ -1313,7 +1313,11 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
     Color backgroundColor = webPage->drawsTransparentBackground() ? Color::transparent : Color::white;
     bool isMainFrame = webPage->mainWebFrame() == m_frame;
     bool shouldUseFixedLayout = isMainFrame && webPage->useFixedLayout();
+#if ENABLE(TIZEN_WEBKIT2_FIX_INVAlID_SCROLL_FOR_NEW_PAGE)
+     IntRect currentFixedVisibleContentRect = m_frame->coreFrame()->view() ? IntRect(IntPoint::zero(), m_frame->coreFrame()->view()->fixedVisibleContentRect().size()) : IntRect();
+#else
     IntRect currentFixedVisibleContentRect = m_frame->coreFrame()->view() ? m_frame->coreFrame()->view()->fixedVisibleContentRect() : IntRect();
+#endif
 
     const ResourceResponse& response = m_frame->coreFrame()->loader()->documentLoader()->response();
     m_frameHasCustomRepresentation = isMainFrame && WebProcess::shared().shouldUseCustomRepresentationForResponse(response);