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

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

Issue 1056983004: OverscrollGlow for mainThread-{BLINK CHANGES} (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased to latest Created 5 years, 6 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 74f6b858ebae01d00fde295f647f98403cca532e..964f75c56e520c10f658efe7dbae5e389d7c8360 100644
--- a/Source/core/frame/RootFrameViewport.cpp
+++ b/Source/core/frame/RootFrameViewport.cpp
@@ -91,7 +91,7 @@ ScrollResult RootFrameViewport::handleWheel(const PlatformWheelEvent& event)
{
updateScrollAnimator();
- ScrollResult viewScrollResult(false);
+ ScrollResult viewScrollResult;
if (layoutViewport().isScrollable())
viewScrollResult = layoutViewport().handleWheel(event);
@@ -102,7 +102,7 @@ ScrollResult RootFrameViewport::handleWheel(const PlatformWheelEvent& event)
// Move the location by the negative of the remaining scroll delta.
DoublePoint oldOffset = visualViewport().scrollPositionDouble();
DoublePoint locationDelta;
- if (viewScrollResult.didScroll) {
+ if (viewScrollResult.didScroll()) {
locationDelta = -DoublePoint(viewScrollResult.unusedScrollDeltaX, viewScrollResult.unusedScrollDeltaY);
} else {
if (event.railsMode() != PlatformEvent::RailsModeVertical)
@@ -116,11 +116,13 @@ ScrollResult RootFrameViewport::handleWheel(const PlatformWheelEvent& event)
visualViewport().scrollToOffsetWithoutAnimation(FloatPoint(targetPosition));
DoublePoint usedLocationDelta(visualViewport().scrollPositionDouble() - oldOffset);
- if (!viewScrollResult.didScroll && usedLocationDelta == DoublePoint::zero())
- return ScrollResult(false);
+ if (!viewScrollResult.didScroll() && usedLocationDelta == DoublePoint::zero())
+ return ScrollResult();
DoubleSize unusedLocationDelta(locationDelta - usedLocationDelta);
- return ScrollResult(true, -unusedLocationDelta.width(), -unusedLocationDelta.height());
+ bool didScrollX = viewScrollResult.didScrollX || unusedLocationDelta.width();
+ bool didScrollY = viewScrollResult.didScrollY || unusedLocationDelta.height();
+ return ScrollResult(didScrollX, didScrollY, -unusedLocationDelta.width(), -unusedLocationDelta.height());
}
LayoutRect RootFrameViewport::scrollIntoView(const LayoutRect& rectInContent, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
@@ -276,7 +278,7 @@ GraphicsLayer* RootFrameViewport::layerForVerticalScrollbar() const
return layoutViewport().layerForVerticalScrollbar();
}
-bool RootFrameViewport::userScroll(ScrollDirectionPhysical direction, ScrollGranularity granularity, float delta)
+ScrollResultOneDimensional RootFrameViewport::userScroll(ScrollDirectionPhysical direction, ScrollGranularity granularity, float delta)
{
updateScrollAnimator();
@@ -296,7 +298,7 @@ bool RootFrameViewport::userScroll(ScrollDirectionPhysical direction, ScrollGran
if (layoutViewport().userInputScrollable(orientation))
return layoutViewport().userScroll(direction, granularity, delta);
- return false;
+ return ScrollResultOneDimensional(false, delta);
}
bool RootFrameViewport::scrollAnimatorEnabled() const
« 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