Index: Source/core/frame/RootFrameViewport.cpp |
diff --git a/Source/core/frame/RootFrameViewport.cpp b/Source/core/frame/RootFrameViewport.cpp |
index 3ba978fd47f6bf304fb7f05ff327a2e0d915b761..2b5cbaa1d12562f617f1e4d4b91532a7157d7605 100644 |
--- a/Source/core/frame/RootFrameViewport.cpp |
+++ b/Source/core/frame/RootFrameViewport.cpp |
@@ -96,9 +96,7 @@ ScrollResult RootFrameViewport::handleWheel(const PlatformWheelEvent& event) |
{ |
updateScrollAnimator(); |
- ScrollResult viewScrollResult; |
- if (layoutViewport().isScrollable()) |
- viewScrollResult = layoutViewport().handleWheel(event); |
+ ScrollResult viewScrollResult = layoutViewport().handleWheel(event); |
// The visual viewport will only accept pixel scrolls. |
if (!event.canScroll() || event.granularity() == ScrollByPageWheelEvent) |
@@ -119,15 +117,10 @@ ScrollResult RootFrameViewport::handleWheel(const PlatformWheelEvent& event) |
DoublePoint targetPosition = visualViewport().adjustScrollPositionWithinRange( |
visualViewport().scrollPositionDouble() + toDoubleSize(locationDelta)); |
visualViewport().setScrollPosition(targetPosition, UserScroll); |
- |
DoublePoint usedLocationDelta(visualViewport().scrollPositionDouble() - oldOffset); |
- if (!viewScrollResult.didScroll() && usedLocationDelta == DoublePoint::zero()) |
- return ScrollResult(); |
- |
- DoubleSize unusedLocationDelta(locationDelta - usedLocationDelta); |
- bool didScrollX = viewScrollResult.didScrollX || unusedLocationDelta.width(); |
- bool didScrollY = viewScrollResult.didScrollY || unusedLocationDelta.height(); |
- return ScrollResult(didScrollX, didScrollY, -unusedLocationDelta.width(), -unusedLocationDelta.height()); |
+ bool didScrollX = viewScrollResult.didScrollX || usedLocationDelta.x(); |
+ bool didScrollY = viewScrollResult.didScrollY || usedLocationDelta.y(); |
+ return ScrollResult(didScrollX, didScrollY, viewScrollResult.unusedScrollDeltaX - usedLocationDelta.x(), viewScrollResult.unusedScrollDeltaY - usedLocationDelta.y()); |
bokan
2015/06/25 17:50:31
Is this working as expected? AFAICT, the unusedScr
MuVen
2015/06/26 09:55:44
You are right on this. i was negating the unusedDe
|
} |
LayoutRect RootFrameViewport::scrollIntoView(const LayoutRect& rectInContent, const ScrollAlignment& alignX, const ScrollAlignment& alignY) |