Changeset 84296 in webkit
- Timestamp:
- Apr 19, 2011, 2:30:54 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r84292 r84296 1 2011-04-19 Beth Dakin <bdakin@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 https://bugs.webkit.org/show_bug.cgi?id=57898 6 REGRESSION (r82185): Scroll position not restored on navigation back to a page in 7 the page cache 8 -and corresponding- 9 <rdar://problem/9226652> 10 11 * fast/loader/resources/empty-document-goes-back.html: Added. 12 * fast/loader/scroll-position-restored-on-back-expected.txt: Added. 13 * fast/loader/scroll-position-restored-on-back.html: Added. 14 1 15 2011-04-19 Ryosuke Niwa <rniwa@webkit.org> 2 16 -
trunk/Source/WebCore/ChangeLog
r84290 r84296 1 2011-04-19 Beth Dakin <bdakin@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 https://bugs.webkit.org/show_bug.cgi?id=57898 6 REGRESSION (r82185): Scroll position not restored on navigation back to a page in 7 the page cache 8 -and corresponding- 9 <rdar://problem/9226652> 10 11 Setting the contentsSize of a ScrollView to (0, 0) necessarily causes the scroll 12 position to be lost. (The scroll position is computed based on the 13 visibleContentSize.) This patch provides a mechanism to cache the current scroll 14 position, and then the HistoryController accesses only the cached position rather 15 than calling scrollPosition() which does a computation based on the 16 visibleContentSize. 17 18 * loader/HistoryController.cpp: 19 (WebCore::HistoryController::saveScrollPositionAndViewStateToItem): 20 * page/FrameView.cpp: 21 (WebCore::FrameView::resetScrollbarsAndClearContentsSize): 22 * platform/ScrollView.h: 23 (WebCore::ScrollView::cacheCurrentScrollPosition): 24 (WebCore::ScrollView::cachedScrollPosition): 25 1 26 2011-04-19 Renata Hodovan <reni@webkit.org> 2 27 -
trunk/Source/WebCore/loader/HistoryController.cpp
r83547 r84296 80 80 return; 81 81 82 item->setScrollPoint(m_frame->view()-> scrollPosition());82 item->setScrollPoint(m_frame->view()->cachedScrollPosition()); 83 83 item->setPageScaleFactor(m_frame->pageScaleFactor()); 84 84 -
trunk/Source/WebCore/page/FrameView.cpp
r84066 r84296 259 259 void FrameView::resetScrollbarsAndClearContentsSize() 260 260 { 261 // Since the contents size is being cleared, the scroll position will lost as a consequence. 262 // Cache the scroll position so it can be restored by the page cache if necessary. 263 cacheCurrentScrollPosition(); 264 261 265 resetScrollbars(); 262 266 -
trunk/Source/WebCore/platform/ScrollView.h
r83899 r84296 180 180 IntSize overhangAmount() const; 181 181 182 void cacheCurrentScrollPosition() { m_cachedScrollPosition = scrollPosition(); } 183 IntPoint cachedScrollPosition() const { return m_cachedScrollPosition; } 184 182 185 // Functions for scrolling the view. 183 186 void setScrollPosition(const IntPoint&); … … 339 342 IntRect m_actualVisibleContentRect; 340 343 IntSize m_scrollOffset; // FIXME: Would rather store this as a position, but we will wait to make this change until more code is shared. 344 IntPoint m_cachedScrollPosition; 341 345 IntSize m_fixedLayoutSize; 342 346 IntSize m_contentsSize;
Note:
See TracChangeset
for help on using the changeset viewer.