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

Unified Diff: Source/core/frame/RootFrameViewport.cpp

Issue 1298973004: Remove special wheel handling path from ScrollableArea (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed TODO Created 5 years, 4 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 | « Source/core/frame/RootFrameViewport.h ('k') | Source/core/frame/RootFrameViewportTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/RootFrameViewport.cpp
diff --git a/Source/core/frame/RootFrameViewport.cpp b/Source/core/frame/RootFrameViewport.cpp
index 6ba7d2e5d353e405d89374dfaf3594284ac09da3..804512c5259f68d390b0b8dcc2bbed5996261b56 100644
--- a/Source/core/frame/RootFrameViewport.cpp
+++ b/Source/core/frame/RootFrameViewport.cpp
@@ -93,47 +93,6 @@ ScrollBehavior RootFrameViewport::scrollBehaviorStyle() const
return layoutViewport().scrollBehaviorStyle();
}
-ScrollResult RootFrameViewport::handleWheel(const PlatformWheelEvent& event)
-{
- updateScrollAnimator();
-
- ScrollableArea& primary = !m_invertScrollOrder ? layoutViewport() : visualViewport();
- ScrollableArea& secondary = !m_invertScrollOrder ? visualViewport() : layoutViewport();
-
- ScrollResult viewScrollResult = primary.handleWheel(event);
-
- // The visual viewport will only accept pixel scrolls.
- if (!event.canScroll() || event.granularity() == ScrollByPageWheelEvent)
- return viewScrollResult;
-
- // TODO(sataya.m) : The delta in PlatformWheelEvent is negative when scrolling the
- // wheel towards the user, so negate it to get the scroll delta that should be applied
- // to the page. unusedScrollDelta computed in the ScrollResult is also negative. Say
- // there is WheelEvent({0, -10} and page scroll by 2px and unusedScrollDelta computed
- // is {0, -8}. Due to which we have to negate the unusedScrollDelta to obtain the expected
- // animation.Please address http://crbug.com/504389.
- DoublePoint oldOffset = secondary.scrollPositionDouble();
- DoublePoint locationDelta;
- if (viewScrollResult.didScroll()) {
- locationDelta = -DoublePoint(viewScrollResult.unusedScrollDeltaX, viewScrollResult.unusedScrollDeltaY);
- } else {
- if (event.railsMode() != PlatformEvent::RailsModeVertical)
- locationDelta.setX(-event.deltaX());
- if (event.railsMode() != PlatformEvent::RailsModeHorizontal)
- locationDelta.setY(-event.deltaY());
- }
-
- DoublePoint targetPosition = secondary.clampScrollPosition(
- secondary.scrollPositionDouble() + toDoubleSize(locationDelta));
- secondary.setScrollPosition(targetPosition, UserScroll);
-
- DoublePoint usedLocationDelta(secondary.scrollPositionDouble() - oldOffset);
-
- bool didScrollX = viewScrollResult.didScrollX || usedLocationDelta.x();
- bool didScrollY = viewScrollResult.didScrollY || usedLocationDelta.y();
- return ScrollResult(didScrollX, didScrollY, -viewScrollResult.unusedScrollDeltaX - usedLocationDelta.x(), -viewScrollResult.unusedScrollDeltaY - usedLocationDelta.y());
-}
-
LayoutRect RootFrameViewport::scrollIntoView(const LayoutRect& rectInContent, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
{
// We want to move the rect into the viewport that excludes the scrollbars so we intersect
« no previous file with comments | « Source/core/frame/RootFrameViewport.h ('k') | Source/core/frame/RootFrameViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698