Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5211)

Unified Diff: WebCore/platform/ScrollView.cpp

Issue 3552012: Merge 69257 - 2010-10-06 Peter Kasting <pkasting@google.com>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « WebCore/ChangeLog ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/platform/ScrollView.cpp
===================================================================
--- WebCore/platform/ScrollView.cpp (revision 69257)
+++ WebCore/platform/ScrollView.cpp (working copy)
@@ -671,27 +671,27 @@
return;
}
- // Determine how much we want to scroll. If we can move at all, we will accept the event.
+ // Accept the event if we have a scrollbar in that direction and can still
+ // scroll any further.
+ float deltaX = m_horizontalScrollbar ? e.deltaX() : 0;
+ float deltaY = m_verticalScrollbar ? e.deltaY() : 0;
IntSize maxScrollDelta = maximumScrollPosition() - scrollPosition();
- if ((e.deltaX() < 0 && maxScrollDelta.width() > 0) ||
- (e.deltaX() > 0 && scrollOffset().width() > 0) ||
- (e.deltaY() < 0 && maxScrollDelta.height() > 0) ||
- (e.deltaY() > 0 && scrollOffset().height() > 0)) {
+ if ((deltaX < 0 && maxScrollDelta.width() > 0)
+ || (deltaX > 0 && scrollOffset().width() > 0)
+ || (deltaY < 0 && maxScrollDelta.height() > 0)
+ || (deltaY > 0 && scrollOffset().height() > 0)) {
e.accept();
- float deltaX = e.deltaX();
- float deltaY = e.deltaY();
if (e.granularity() == ScrollByPageWheelEvent) {
- ASSERT(deltaX == 0);
+ ASSERT(!e.deltaX());
bool negative = deltaY < 0;
deltaY = max(max(static_cast<float>(visibleHeight()) * Scrollbar::minFractionToStepWhenPaging(), static_cast<float>(visibleHeight() - Scrollbar::maxOverlapBetweenPages())), 1.0f);
if (negative)
deltaY = -deltaY;
}
- // Should we fall back on scrollBy() if there is no scrollbar for a non-zero delta?
- if (deltaY && m_verticalScrollbar)
+ if (deltaY)
m_verticalScrollbar->scroll(ScrollUp, ScrollByPixel, deltaY);
- if (deltaX && m_horizontalScrollbar)
+ if (deltaX)
m_horizontalScrollbar->scroll(ScrollLeft, ScrollByPixel, deltaX);
}
}
« no previous file with comments | « WebCore/ChangeLog ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698