Changeset 285917 in webkit
- Timestamp:
- Nov 16, 2021, 10:25:17 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/scrolling/mac/momentum-animator-end-event-stops-expected.txt (added)
-
LayoutTests/fast/scrolling/mac/momentum-animator-end-event-stops.html (added)
-
LayoutTests/platform/mac-wk2/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/ScrollingEffectsController.h (modified) (1 diff)
-
Source/WebCore/platform/mac/ScrollingEffectsController.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r285912 r285917 1 2021-11-16 Simon Fraser <simon.fraser@apple.com> 2 3 Stop a momentum scroll animation when receiving a momentum end event 4 https://bugs.webkit.org/show_bug.cgi?id=233236 5 6 Reviewed by Tim Horton. 7 8 New test, and skip one that breaks now because we need a fix for webkit.org/b/233234. 9 10 * fast/scrolling/mac/momentum-animator-end-event-stops-expected.txt: Added. 11 * fast/scrolling/mac/momentum-animator-end-event-stops.html: Added. 12 * platform/mac-wk2/TestExpectations: 13 1 14 2021-11-16 Sihui Liu <sihui_liu@apple.com> 2 15 -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r285669 r285917 1563 1563 1564 1564 webkit.org/b/228591 fast/scrolling/mac/programmatic-scroll-overrides-rubberband.html [ Pass Failure ] 1565 webkit.org/b/233234 fast/scrolling/mac/momentum-animator-in-overflow.html [ Failure ] 1565 1566 1566 1567 webkit.org/b/229156 [ BigSur+ ] webrtc/video-addTrack.html [ Pass Failure ] -
trunk/Source/WebCore/ChangeLog
r285916 r285917 1 2021-11-16 Simon Fraser <simon.fraser@apple.com> 2 3 Stop a momentum scroll animation when receiving a momentum end event 4 https://bugs.webkit.org/show_bug.cgi?id=233236 5 6 Reviewed by Tim Horton. 7 8 The stream of momentum events is terminated by an "end" event under two circumstances: 9 1. The gesture finished naturally without interruption. 10 2. The user tapped the trackpad with two fingers. 11 12 Unfortunately we can't tell these apart, so we always have to stop the animation. 13 14 Sadly this reveals a hole in the testing infrastructure. All the "changed" momentum 15 events in the sequence handed to UIHelper.mouseWheelSequence() are ignored while the 16 animation is running, but the "ended" event stops the animation. So any test without 17 a reasonable number of "changed" events will terminate its animation prematurely. 18 We can't fix this without new testing infrastructure (webkit.org/b/233234). 19 20 Test: fast/scrolling/mac/momentum-animator-end-event-stops.html 21 22 * platform/ScrollingEffectsController.h: 23 * platform/mac/ScrollingEffectsController.mm: 24 (WebCore::ScrollingEffectsController::handleWheelEvent): 25 1 26 2021-11-16 Said Abou-Hallawa <said@apple.com> 2 27 -
trunk/Source/WebCore/platform/ScrollingEffectsController.h
r285787 r285917 264 264 FloatSize m_scrollingVelocityForScrollSnap; 265 265 #if !LOG_DISABLED 266 FloatPoint m_eventDrivenScrollMomentumStartOffset; 266 267 FloatPoint m_eventDrivenScrollOffset; 268 WallTime m_momentumBeganEventTime; 267 269 #endif 268 270 -
trunk/Source/WebCore/platform/mac/ScrollingEffectsController.mm
r285797 r285917 181 181 } 182 182 183 #if !LOG_DISABLED 184 if (wheelEvent.momentumPhase() == PlatformWheelEventPhase::Began) 185 m_momentumBeganEventTime = wheelEvent.timestamp(); 186 #endif 187 188 if (wheelEvent.momentumPhase() == PlatformWheelEventPhase::Ended && momentumScrollingAnimatorEnabled()) { 189 #if !LOG_DISABLED 190 auto timeSinceStart = wheelEvent.timestamp() - m_momentumBeganEventTime; 191 auto distance = m_eventDrivenScrollOffset - m_eventDrivenScrollMomentumStartOffset; 192 #endif 193 // FIXME: We can't distinguish between the natural end of a momentum sequence, and a two-finger tap on the trackpad (rdar://85414238), 194 // so we always have to end the animation here. 195 LOG(ScrollAnimations, "Event (%s, %s): stopping event scroll duration %.2fms distance %.2f %.2f", 196 phaseToString(wheelEvent.phase()), phaseToString(wheelEvent.momentumPhase()), timeSinceStart.milliseconds(), 197 fabs(distance.width()), fabs(distance.height())); 198 stopAnimatedNonRubberbandingScroll(); 199 } 200 183 201 bool isMomentumScrollEvent = (wheelEvent.momentumPhase() != PlatformWheelEventPhase::None); 184 202 if (m_ignoreMomentumScrolls && (isMomentumScrollEvent || m_isAnimatingRubberBand)) { … … 214 232 #if !LOG_DISABLED 215 233 m_eventDrivenScrollOffset = m_client.scrollOffset(); 234 m_eventDrivenScrollMomentumStartOffset = m_eventDrivenScrollOffset; 216 235 #endif 217 236 }
Note:
See TracChangeset
for help on using the changeset viewer.