Address post-review feedback following r209070 (AppKit momentum scrolling adoption...
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Nov 2016 21:12:26 +0000 (21:12 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Nov 2016 21:12:26 +0000 (21:12 +0000)
commit3b656ab1509c22b9520856fe0aa4419e4703b63d
tree1e294db354ac213d213909dffc81aad218150367
parent6ef26432ed8628444164edc1a2f4a70da6b5a75a
Address post-review feedback following r209070 (AppKit momentum scrolling adoption for scroll snapping)
https://bugs.webkit.org/show_bug.cgi?id=165147

Reviewed by Simon Fraser.

Addresses some additional review feedback after r209070, which adopts _NSScrollingMomentumCalculator for scroll
snapping. See individual changes below for more details. No new tests, since there is no behavior change.

* page/EventHandler.cpp:
(WebCore::handleWheelEventInAppropriateEnclosingBox):
(WebCore::EventHandler::defaultWheelEventHandler):
* page/Page.cpp:
(WebCore::Page::ensureTestTrigger):
* page/WheelEventDeltaFilter.cpp:
(WebCore::WheelEventDeltaFilter::filteredVelocity):
* page/WheelEventDeltaFilter.h:
* page/mac/WheelEventDeltaFilterMac.mm:
(WebCore::WheelEventDeltaFilterMac::updateFromDelta):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView):

Rather than force a complete layout pass when the Page first acquires a WheelEventTestTrigger, we now simply
have the scrolling coordinator update its frame node to expect a wheel event test trigger.

* page/scrolling/ScrollingMomentumCalculator.cpp:
(WebCore::ScrollingMomentumCalculator::ScrollingMomentumCalculator):
(WebCore::ScrollingMomentumCalculator::create):
(WebCore::BasicScrollingMomentumCalculator::BasicScrollingMomentumCalculator):
(WebCore::BasicScrollingMomentumCalculator::scrollOffsetAfterElapsedTime):
(WebCore::BasicScrollingMomentumCalculator::animationDuration):
(WebCore::BasicScrollingMomentumCalculator::initializeSnapProgressCurve):
(WebCore::BasicScrollingMomentumCalculator::animationProgressAfterElapsedTime):
* page/scrolling/ScrollingMomentumCalculator.h:
* page/scrolling/mac/ScrollingMomentumCalculatorMac.h:
* page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
(WebCore::ScrollingMomentumCalculator::create):
(WebCore::ScrollingMomentumCalculatorMac::ScrollingMomentumCalculatorMac):
(WebCore::ScrollingMomentumCalculatorMac::scrollOffsetAfterElapsedTime):
(WebCore::ScrollingMomentumCalculatorMac::animationDuration):
(WebCore::ScrollingMomentumCalculatorMac::ensurePlatformMomentumCalculator):
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::copyWithDeltasAndVelocity):
(WebCore::PlatformWheelEvent::scrollingVelocity):

Change scrolling velocity in PlatformWheelEvent to be a FloatSize instead of a FloatPoint. This change
propagates to the ScrollController, where state variables and arguments pertaining to scrolling velocity are
also now sizes instead of points.

* platform/cocoa/ScrollController.h:
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::scheduleStatelessScrollSnap):
* platform/cocoa/ScrollSnapAnimatorState.h:
* platform/cocoa/ScrollSnapAnimatorState.mm:
(WebCore::ScrollSnapAnimatorState::transitionToGlideAnimationState):
(WebCore::ScrollSnapAnimatorState::setupAnimationForState):
(WebCore::ScrollSnapAnimatorState::teardownAnimationForState):
(WebCore::ScrollSnapAnimatorState::currentAnimatedScrollOffset):

Refactor elapsed time to be Seconds instead of double. Additionally, use MonotonicTime::now() instead of
monotonicallyIncreasingTime(), and MonotonicTime instead of double for keeping track of the start time.

* platform/spi/mac/NSScrollingMomentumCalculatorSPI.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/WheelEventDeltaFilter.cpp
Source/WebCore/page/WheelEventDeltaFilter.h
Source/WebCore/page/mac/WheelEventDeltaFilterMac.mm
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingMomentumCalculator.cpp
Source/WebCore/page/scrolling/ScrollingMomentumCalculator.h
Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.h
Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.mm
Source/WebCore/platform/PlatformWheelEvent.h
Source/WebCore/platform/cocoa/ScrollController.h
Source/WebCore/platform/cocoa/ScrollController.mm
Source/WebCore/platform/cocoa/ScrollSnapAnimatorState.h
Source/WebCore/platform/cocoa/ScrollSnapAnimatorState.mm
Source/WebCore/platform/spi/mac/NSScrollingMomentumCalculatorSPI.h