Changeset 286035 in webkit
- Timestamp:
- Nov 18, 2021, 3:20:09 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
-
ChangeLog (modified) (1 diff)
-
page/WheelEventTestMonitor.cpp (modified) (1 diff)
-
page/WheelEventTestMonitor.h (modified) (1 diff)
-
platform/ScrollingEffectsController.cpp (modified) (6 diffs)
-
platform/ScrollingEffectsController.h (modified) (2 diffs)
-
platform/mac/ScrollingEffectsController.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r286027 r286035 1 2021-11-18 Simon Fraser <simon.fraser@apple.com> 2 3 Teach WheelEventTestMonitor about scroll animations 4 https://bugs.webkit.org/show_bug.cgi?id=233296 5 6 Reviewed by Tim Horton. 7 8 There was no way for a test to wait for a scroll animation to finish, so enhance 9 WheelEventTestMonitor to know about scroll animations. 10 11 ScrollAnimationInProgress should probably subsume the RubberbandInProgress and 12 ScrollSnapInProgress reasons, but those are left alone for now. 13 14 * page/WheelEventTestMonitor.cpp: 15 (WebCore::operator<<): 16 * page/WheelEventTestMonitor.h: 17 * platform/ScrollingEffectsController.cpp: 18 (WebCore::ScrollingEffectsController::startScrollSnapAnimation): 19 (WebCore::ScrollingEffectsController::stopScrollSnapAnimation): 20 (WebCore::ScrollingEffectsController::scrollAnimationWillStart): 21 (WebCore::ScrollingEffectsController::scrollAnimationDidEnd): 22 (WebCore::ScrollingEffectsController::startDeferringWheelEventTestCompletion): 23 (WebCore::ScrollingEffectsController::stopDeferringWheelEventTestCompletion): 24 * platform/ScrollingEffectsController.h: 25 * platform/mac/ScrollingEffectsController.mm: 26 (WebCore::ScrollingEffectsController::scheduleStatelessScrollSnap): 27 (WebCore::ScrollingEffectsController::startDeferringWheelEventTestCompletionDueToScrollSnapping): Deleted. 28 (WebCore::ScrollingEffectsController::stopDeferringWheelEventTestCompletionDueToScrollSnapping): Deleted. 29 1 30 2021-11-18 Chris Dumez <cdumez@apple.com> 2 31 -
trunk/Source/WebCore/page/WheelEventTestMonitor.cpp
r284857 r286035 175 175 case WheelEventTestMonitor::RubberbandInProgress: ts << "rubberbanding"; break; 176 176 case WheelEventTestMonitor::ScrollSnapInProgress: ts << "scroll-snapping"; break; 177 case WheelEventTestMonitor::ScrollAnimationInProgress: ts << "scroll animation"; break; 177 178 case WheelEventTestMonitor::ScrollingThreadSyncNeeded: ts << "scrolling thread sync needed"; break; 178 179 case WheelEventTestMonitor::ContentScrollInProgress: ts << "content scrolling"; break; -
trunk/Source/WebCore/page/WheelEventTestMonitor.h
r284857 r286035 54 54 RubberbandInProgress = 1 << 3, 55 55 ScrollSnapInProgress = 1 << 4, 56 ScrollingThreadSyncNeeded = 1 << 5, 57 ContentScrollInProgress = 1 << 6, 58 RequestedScrollPosition = 1 << 7, 56 ScrollAnimationInProgress = 1 << 5, 57 ScrollingThreadSyncNeeded = 1 << 6, 58 ContentScrollInProgress = 1 << 7, 59 RequestedScrollPosition = 1 << 8, 59 60 }; 60 61 typedef const void* ScrollableAreaIdentifier; -
trunk/Source/WebCore/platform/ScrollingEffectsController.cpp
r285787 r286035 35 35 #include "ScrollExtents.h" 36 36 #include "ScrollableArea.h" 37 #include "WheelEventTestMonitor.h"38 37 #include <wtf/text/TextStream.h> 39 38 … … 447 446 LOG_WITH_STREAM(ScrollSnap, stream << "ScrollingEffectsController " << this << " startScrollSnapAnimation (main thread " << isMainThread() << ")"); 448 447 449 #if PLATFORM(MAC) 450 startDeferringWheelEventTestCompletionDueToScrollSnapping(); 451 #endif 448 startDeferringWheelEventTestCompletion(WheelEventTestMonitor::ScrollSnapInProgress); 452 449 m_client.willStartScrollSnapAnimation(); 453 450 setIsAnimatingScrollSnap(true); … … 461 458 LOG_WITH_STREAM(ScrollSnap, stream << "ScrollingEffectsController " << this << " stopScrollSnapAnimation (main thread " << isMainThread() << ")"); 462 459 463 #if PLATFORM(MAC) 464 stopDeferringWheelEventTestCompletionDueToScrollSnapping(); 465 #endif 460 stopDeferringWheelEventTestCompletion(WheelEventTestMonitor::ScrollSnapInProgress); 466 461 m_client.didStopScrollSnapAnimation(); 467 462 … … 498 493 #endif 499 494 495 startDeferringWheelEventTestCompletion(WheelEventTestMonitor::ScrollAnimationInProgress); 500 496 startOrStopAnimationCallbacks(); 501 497 } … … 520 516 m_client.didStopAnimatedScroll(); 521 517 startOrStopAnimationCallbacks(); 518 stopDeferringWheelEventTestCompletion(WheelEventTestMonitor::ScrollAnimationInProgress); 522 519 } 523 520 … … 525 522 { 526 523 return m_client.scrollExtents(); 524 } 525 526 void ScrollingEffectsController::startDeferringWheelEventTestCompletion(WheelEventTestMonitor::DeferReason reason) 527 { 528 m_client.deferWheelEventTestCompletionForReason(reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(this), reason); 529 } 530 531 void ScrollingEffectsController::stopDeferringWheelEventTestCompletion(WheelEventTestMonitor::DeferReason reason) 532 { 533 m_client.removeWheelEventTestCompletionDeferralForReason(reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(this), reason); 527 534 } 528 535 -
trunk/Source/WebCore/platform/ScrollingEffectsController.h
r285953 r286035 202 202 void statelessSnapTransitionTimerFired(); 203 203 void scheduleStatelessScrollSnap(); 204 void startDeferringWheelEventTestCompletionDueToScrollSnapping();205 void stopDeferringWheelEventTestCompletionDueToScrollSnapping();206 204 207 205 bool modifyScrollDeltaForStretching(const PlatformWheelEvent&, FloatSize&, bool isHorizontallyStretched, bool isVerticallyStretched); … … 225 223 226 224 bool momentumScrollingAnimatorEnabled() const { return m_momentumScrollingAnimatorEnabled; } 225 226 void startDeferringWheelEventTestCompletion(WheelEventTestMonitor::DeferReason); 227 void stopDeferringWheelEventTestCompletion(WheelEventTestMonitor::DeferReason); 227 228 228 229 // ScrollAnimationClient -
trunk/Source/WebCore/platform/mac/ScrollingEffectsController.mm
r285964 r286035 32 32 #import "ScrollExtents.h" 33 33 #import "WheelEventDeltaFilter.h" 34 #import "WheelEventTestMonitor.h"35 34 #import <pal/spi/mac/NSScrollViewSPI.h> 36 35 #import <sys/sysctl.h> … … 681 680 }); 682 681 m_statelessSnapTransitionTimer->startOneShot(statelessScrollSnapDelay); 683 startDeferringWheelEventTestCompletion DueToScrollSnapping();682 startDeferringWheelEventTestCompletion(WheelEventTestMonitor::ScrollSnapInProgress); 684 683 } 685 684 … … 693 692 if (m_scrollSnapState->transitionToSnapAnimationState(m_client.scrollExtents(), m_client.pageScaleFactor(), m_client.scrollOffset())) 694 693 startScrollSnapAnimation(); 695 }696 697 void ScrollingEffectsController::startDeferringWheelEventTestCompletionDueToScrollSnapping()698 {699 m_client.deferWheelEventTestCompletionForReason(reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(this), WheelEventTestMonitor::ScrollSnapInProgress);700 }701 702 void ScrollingEffectsController::stopDeferringWheelEventTestCompletionDueToScrollSnapping()703 {704 m_client.removeWheelEventTestCompletionDeferralForReason(reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(this), WheelEventTestMonitor::ScrollSnapInProgress);705 694 } 706 695
Note:
See TracChangeset
for help on using the changeset viewer.