[WK2] WEB-2776 Page not displaying selected item via context menu
authorSantosh <santosh.ma@samsung.com>
Thu, 4 Apr 2013 09:05:53 +0000 (14:35 +0530)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Mon, 24 Jun 2013 15:22:36 +0000 (15:22 +0000)
[Version] N/A
[Project] TIZEN BROWSER
[Title] WEB-2776 Page not displaying selected item via contextmenu
[BinType] N/A
[Customer] N/A
[Issue#] when the link(e.g htttp://morellc.com/#moreinfo)
 contain hash anchor to current page, the webprocess decide
scroll position when parsing is finished, before page is
rendered fully.But didRenderFrame initializes the scrollPosition to
default position(0,0) thus resetting the old value
of scrollPosition. So resetting the scroll position.
So  that page doesnot scroll upto anchor node

[Problem] page doesnot get scrolled by default when scroll position
is decided before page is rendered completely
[Cause] NA
[Solution] Remmebered the scrollposition(before the page is rendered completely)
and restore that when page is rendered
[Team] Browser(WCS)
[Developer] Santosh Mahto(santosh.ma)

Change-Id: If0fabe8c79be694db9f624f2f26c02776a579b72

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

index f41038a..fc04505 100755 (executable)
@@ -673,6 +673,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. */
 #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 4cc6b20..1e13fde 100755 (executable)
@@ -100,6 +100,9 @@ PageClientImpl::PageClientImpl(EwkViewImpl* viewImpl)
 #if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
     , m_restoredScaleFactor(0)
 #endif
+#if ENABLE(TIZEN_WEBKIT2_BEFORE_PAGE_RENDERED_SCROLL_POSITION)
+    , m_scrollPositionBeforePageRendered(IntPoint())
+#endif
     , m_isVisible(true)
     , m_isScrollableLayerFocused(false)
     , m_isScrollableNodeFocused(false)
@@ -207,6 +210,10 @@ void PageClientImpl::initializeVisibleContentRect()
 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
     IntPoint initialScrollPosition;
     float initialScaleFactor = m_viewportConstraints.initialScale;
+#if ENABLE(TIZEN_WEBKIT2_BEFORE_PAGE_RENDERED_SCROLL_POSITION)
+    initialScrollPosition = m_scrollPositionBeforePageRendered;
+    m_scrollPositionBeforePageRendered = IntPoint();
+#endif
 #if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
     // if scroll position and scale factor are restored by history controller,
     // move scroll position and scale factor with them
@@ -750,8 +757,15 @@ void PageClientImpl::pageDidRequestScroll(const IntPoint& point)
 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
     IntPoint newPoint = point;
     newPoint.scale(scaleFactor(), scaleFactor());
+#if ENABLE(TIZEN_WEBKIT2_BEFORE_PAGE_RENDERED_SCROLL_POSITION)
+    if (!m_pageDidRendered)
+        m_scrollPositionBeforePageRendered = newPoint;
+    else
+        setVisibleContentRect(IntRect(newPoint, m_visibleContentRect.size()), scaleFactor());
+#else
     setVisibleContentRect(IntRect(newPoint, m_visibleContentRect.size()), scaleFactor());
 #endif
+#endif
 }
 #endif
 
index 6d67b6d..a17d42f 100755 (executable)
@@ -420,6 +420,9 @@ protected:
     WebCore::IntPoint m_restoredScrollPosition;
     float m_restoredScaleFactor;
 #endif
+#if ENABLE(TIZEN_WEBKIT2_BEFORE_PAGE_RENDERED_SCROLL_POSITION)
+    WebCore::IntPoint m_scrollPositionBeforePageRendered;
+#endif
 
 #if ENABLE(TIZEN_WEBKIT2_TILED_SCROLLBAR)
     RefPtr<MainFrameScrollbarTizen> m_horizontalScrollbar;