summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
diff options
context:
space:
mode:
authorbokan <bokan@chromium.org>2016-03-01 17:14:36 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-02 01:15:36 +0000
commitf0713e7d9da9b89301ae0ae1228d51fbb2e17afc (patch)
treec827ca0010bf9a9d1225295cee4e044f52f13708 /third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
parent7d77ff3697f64b3c8e5c1c11b0f4c7959baa16fb (diff)
downloadchromium_src-f0713e7d9da9b89301ae0ae1228d51fbb2e17afc.zip
chromium_src-f0713e7d9da9b89301ae0ae1228d51fbb2e17afc.tar.gz
chromium_src-f0713e7d9da9b89301ae0ae1228d51fbb2e17afc.tar.bz2
Removed main-thread one dimensional scrolling paths.
This patch is a large cleanup of the main-thread scrolling paths in Blink. The main change is the removal of most single dimension scrolling paths. These paths, going from EventHandler, through ScrollableAreas, and into ScrollAnimators used a single float and a ScrollDirection to determine how to scroll. This style of scrolling is needed only for a few cases: scrollbar and keyboard scrolling. The fact that Animators and ScrollableAreas work naturally in two dimensions complicated their interface and implementations needlessly. Implementing Wheel and Gesture scrolling required awkward 2-phase scrolls and coordination between them. I've completely replaced the one dimensional interfaces in ScrollableArea and ScrollAnimators with a more standard 2d FloatSize. It's now EventHandler's job, where needed, to translate a direction/float instruction to scroll into the necessary physical scroll used by ScrollableArea. This should make future work and potential CC scroll unification work more straightforward. Some other minor cleanups along the way: -ScrollAnimator and its children use a FloatPoint rather than two floats for current position. -Split EventHandler::scroll into logical and physical. Using it for both made the interface and usage complicated. -Additionally, I've littered a number of TODOs throughout these paths where I found issues and inconsistencies to clean up in future CLs. BUG=591124 Review URL: https://codereview.chromium.org/1738243002 Cr-Commit-Position: refs/heads/master@{#378642}
Diffstat (limited to 'third_party/WebKit/Source/platform/scroll/Scrollbar.cpp')
-rw-r--r--third_party/WebKit/Source/platform/scroll/Scrollbar.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
index f9c0eb2..f1fa7bc 100644
--- a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
+++ b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
@@ -202,7 +202,7 @@ void Scrollbar::autoscrollPressedPart(double delay)
}
// Handle the arrows and track.
- if (m_scrollableArea && m_scrollableArea->userScroll(pressedPartScrollDirectionPhysical(), pressedPartScrollGranularity()).didScroll)
+ if (m_scrollableArea && m_scrollableArea->userScroll(pressedPartScrollGranularity(), toScrollDelta(pressedPartScrollDirectionPhysical(), 1)).didScroll())
startTimerIfNeeded(delay);
}
@@ -353,7 +353,7 @@ bool Scrollbar::gestureEvent(const PlatformGestureEvent& evt)
return false;
case PlatformEvent::GestureTap: {
if (m_pressedPart != ThumbPart && m_pressedPart != NoPart && m_scrollableArea
- && m_scrollableArea->userScroll(pressedPartScrollDirectionPhysical(), pressedPartScrollGranularity()).didScroll) {
+ && m_scrollableArea->userScroll(pressedPartScrollGranularity(), toScrollDelta(pressedPartScrollDirectionPhysical(), 1)).didScroll()) {
return true;
}
m_scrollPos = 0;