+2011-09-26 Alexei Svitkine <asvitkine@chromium.org>
+
+ Fix full-page rubber band overhang appearing when gesturing during a slow page load.
+ https://bugs.webkit.org/show_bug.cgi?id=68568
+
+ Chromium bug: http://code.google.com/p/chromium/issues/detail?id=97243
+
+ (This also happens on Safari.)
+
+ 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.
+
+ Reviewed by Adam Barth.
+
+ No new tests, since this is highly timing-related.
+
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::overhangAmount):
+ (WebCore::ScrollView::wheelEvent):
+
2011-09-26 W. James MacLean <wjmaclean@chromium.org>
[chromium] Revise zoom animator backend to use full transform instead of just scale.
int physicalScrollY = scrollPosition().y() + m_scrollOrigin.y();
if (physicalScrollY < 0)
stretch.setHeight(physicalScrollY);
- else if (physicalScrollY > contentsHeight() - visibleContentRect().height())
- stretch.setHeight(physicalScrollY - (contentsHeight() - visibleContentRect().height()));
+ else if (contentsHeight() && physicalScrollY > contentsHeight() - visibleHeight())
+ stretch.setHeight(physicalScrollY - (contentsHeight() - visibleHeight()));
int physicalScrollX = scrollPosition().x() + m_scrollOrigin.x();
if (physicalScrollX < 0)
stretch.setWidth(physicalScrollX);
- else if (physicalScrollX > contentsWidth() - visibleContentRect().width())
- stretch.setWidth(physicalScrollX - (contentsWidth() - visibleContentRect().width()));
+ else if (contentsWidth() && physicalScrollX > contentsWidth() - visibleWidth())
+ stretch.setWidth(physicalScrollX - (contentsWidth() - visibleWidth()));
return stretch;
}
if (physicalScrollY < 0) {
horizontalOverhangRect = frameRect();
horizontalOverhangRect.setHeight(-physicalScrollY);
- } else if (physicalScrollY > contentsHeight() - visibleContentRect().height()) {
- int height = physicalScrollY - (contentsHeight() - visibleContentRect().height());
+ } else if (contentsHeight() && physicalScrollY > contentsHeight() - visibleHeight()) {
+ int height = physicalScrollY - (contentsHeight() - visibleHeight());
horizontalOverhangRect = frameRect();
horizontalOverhangRect.setY(frameRect().maxY() - height - horizontalScrollbarHeight);
horizontalOverhangRect.setHeight(height);
verticalOverhangRect.setY(frameRect().y() + horizontalOverhangRect.height());
else
verticalOverhangRect.setY(frameRect().y());
- } else if (physicalScrollX > contentsWidth() - visibleContentRect().width()) {
- int width = physicalScrollX - (contentsWidth() - visibleContentRect().width());
+ } else if (contentsWidth() && physicalScrollX > contentsWidth() - visibleWidth()) {
+ int width = physicalScrollX - (contentsWidth() - visibleWidth());
verticalOverhangRect.setWidth(width);
verticalOverhangRect.setHeight(frameRect().height() - horizontalOverhangRect.height());
verticalOverhangRect.setX(frameRect().maxX() - width - verticalScrollbarWidth);