From f489c0ff0761b3f25e6b387abd84c503deadef66 Mon Sep 17 00:00:00 2001 From: Santosh Date: Thu, 4 Apr 2013 14:35:53 +0530 Subject: [PATCH] [WK2] WEB-2776 Page not displaying selected item via context menu [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 | 1 + Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp | 14 ++++++++++++++ Source/WebKit2/UIProcess/API/efl/PageClientImpl.h | 3 +++ 3 files changed, 18 insertions(+) diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h index f41038a..fc04505 100755 --- a/Source/WTF/wtf/Platform.h +++ b/Source/WTF/wtf/Platform.h @@ -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. */ diff --git a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp index 4cc6b20..1e13fde 100755 --- a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp +++ b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp @@ -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 diff --git a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.h b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.h index 6d67b6d..a17d42f 100755 --- a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.h +++ b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.h @@ -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 m_horizontalScrollbar; -- 2.7.4