Changeset 95997 in webkit
- Timestamp:
- Sep 26, 2011 2:44:26 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r95988 r95997 1 2011-09-26 Alexei Svitkine <asvitkine@chromium.org> 2 3 Fix full-page rubber band overhang appearing when gesturing during a slow page load. 4 https://bugs.webkit.org/show_bug.cgi?id=68568 5 6 Chromium bug: http://code.google.com/p/chromium/issues/detail?id=97243 7 8 (This also happens on Safari.) 9 10 The problem was that ScrollView::overhangAmount() was returning a full-page overhang due to contentsSize() being 0 briefly during a page load, which was then getting used by ScrollAnimatorChromiumMac.mm to update the overhang on a gesture event. This change makes the relevant logic not return an overhang if the contentsSize() is empty. 11 12 Reviewed by Adam Barth. 13 14 No new tests, since this is highly timing-related. 15 16 * platform/ScrollView.cpp: 17 (WebCore::ScrollView::overhangAmount): 18 (WebCore::ScrollView::wheelEvent): 19 1 20 2011-09-26 W. James MacLean <wjmaclean@chromium.org> 2 21 -
trunk/Source/WebCore/platform/ScrollView.cpp
r95901 r95997 412 412 if (physicalScrollY < 0) 413 413 stretch.setHeight(physicalScrollY); 414 else if ( physicalScrollY > contentsHeight() - visibleContentRect().height())415 stretch.setHeight(physicalScrollY - (contentsHeight() - visible ContentRect().height()));414 else if (contentsHeight() && physicalScrollY > contentsHeight() - visibleHeight()) 415 stretch.setHeight(physicalScrollY - (contentsHeight() - visibleHeight())); 416 416 417 417 int physicalScrollX = scrollPosition().x() + m_scrollOrigin.x(); 418 418 if (physicalScrollX < 0) 419 419 stretch.setWidth(physicalScrollX); 420 else if ( physicalScrollX > contentsWidth() - visibleContentRect().width())421 stretch.setWidth(physicalScrollX - (contentsWidth() - visible ContentRect().width()));420 else if (contentsWidth() && physicalScrollX > contentsWidth() - visibleWidth()) 421 stretch.setWidth(physicalScrollX - (contentsWidth() - visibleWidth())); 422 422 423 423 return stretch; … … 1047 1047 horizontalOverhangRect = frameRect(); 1048 1048 horizontalOverhangRect.setHeight(-physicalScrollY); 1049 } else if ( physicalScrollY > contentsHeight() - visibleContentRect().height()) {1050 int height = physicalScrollY - (contentsHeight() - visible ContentRect().height());1049 } else if (contentsHeight() && physicalScrollY > contentsHeight() - visibleHeight()) { 1050 int height = physicalScrollY - (contentsHeight() - visibleHeight()); 1051 1051 horizontalOverhangRect = frameRect(); 1052 1052 horizontalOverhangRect.setY(frameRect().maxY() - height - horizontalScrollbarHeight); … … 1063 1063 else 1064 1064 verticalOverhangRect.setY(frameRect().y()); 1065 } else if ( physicalScrollX > contentsWidth() - visibleContentRect().width()) {1066 int width = physicalScrollX - (contentsWidth() - visible ContentRect().width());1065 } else if (contentsWidth() && physicalScrollX > contentsWidth() - visibleWidth()) { 1066 int width = physicalScrollX - (contentsWidth() - visibleWidth()); 1067 1067 verticalOverhangRect.setWidth(width); 1068 1068 verticalOverhangRect.setHeight(frameRect().height() - horizontalOverhangRect.height());
Note: See TracChangeset
for help on using the changeset viewer.