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

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: addressed review comments Created 5 years, 7 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
Index: Source/core/frame/RootFrameViewport.cpp
diff --git a/Source/core/frame/RootFrameViewport.cpp b/Source/core/frame/RootFrameViewport.cpp
index e2dea23147c9d10a6b7a77eb7369492215801485..5079f0ed6825a8057102b3774c2747b97a8f1e6f 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,11 @@ 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());
+ return ScrollResult(locationDelta.x()-usedLocationDelta.x(), locationDelta.y()-usedLocationDelta.y(), -unusedLocationDelta.width(), -unusedLocationDelta.height());
MuVen 2015/06/02 09:04:00 This shall return didScrollX and didScrollY scroll
majidvp 2015/06/02 17:00:31 Yes but I don't think the calculation is incorrect
MuVen 2015/06/03 09:32:18 Done.
}
LayoutRect RootFrameViewport::scrollIntoView(const LayoutRect& rectInContent, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
@@ -276,7 +276,7 @@ GraphicsLayer* RootFrameViewport::layerForVerticalScrollbar() const
return layoutViewport().layerForVerticalScrollbar();
}
-bool RootFrameViewport::scroll(ScrollDirectionPhysical direction, ScrollGranularity granularity, float delta)
+ScrollResultOneDimensional RootFrameViewport::scroll(ScrollDirectionPhysical direction, ScrollGranularity granularity, float delta)
{
updateScrollAnimator();
@@ -296,7 +296,7 @@ bool RootFrameViewport::scroll(ScrollDirectionPhysical direction, ScrollGranular
if (layoutViewport().userInputScrollable(orientation))
return layoutViewport().scroll(direction, granularity, delta);
- return false;
+ return ScrollResultOneDimensional(false);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698