Changeset 259820 in webkit
- Timestamp:
- Apr 9, 2020, 1:36:21 PM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/page/Page.cpp (modified) (1 diff)
-
WebCore/page/Page.h (modified) (2 diffs)
-
WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm (modified) (1 diff)
-
WebCore/testing/js/WebCoreTestSupport.cpp (modified) (2 diffs)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r259819 r259820 1 2020-04-09 Simon Fraser <simon.fraser@apple.com> 2 3 eventSender.monitorWheelEvents() should clear latching state 4 https://bugs.webkit.org/show_bug.cgi?id=210288 5 6 Reviewed by Tim Horton. 7 8 Use monitorWheelEvents() as a trigger to clear scroll latching state, both main-thread (via Page) 9 and scrolling thread (via ScrollingTree). 10 11 Page::ensureWheelEventTestMonitor() had side-effects, so hide it, and have clients explicitly call Page::startMonitoringWheelEvents(). 12 13 * page/Page.cpp: 14 (WebCore::Page::startMonitoringWheelEvents): 15 (WebCore::Page::ensureWheelEventTestMonitor): 16 * page/Page.h: 17 * testing/js/WebCoreTestSupport.cpp: 18 (WebCoreTestSupport::monitorWheelEvents): 19 (WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring): 20 1 21 2020-04-09 Wenson Hsieh <wenson_hsieh@apple.com> 2 22 -
trunk/Source/WebCore/page/Page.cpp
r259772 r259820 2642 2642 } 2643 2643 2644 void Page::startMonitoringWheelEvents() 2645 { 2646 ensureWheelEventTestMonitor().clearAllTestDeferrals(); 2647 2648 #if ENABLE(WHEEL_EVENT_LATCHING) 2649 resetLatchingState(); 2650 #endif 2651 2652 if (auto* frameView = mainFrame().view()) { 2653 if (m_scrollingCoordinator) { 2654 m_scrollingCoordinator->startMonitoringWheelEvents(); 2655 m_scrollingCoordinator->updateIsMonitoringWheelEventsForFrameView(*frameView); 2656 } 2657 } 2658 } 2659 2644 2660 WheelEventTestMonitor& Page::ensureWheelEventTestMonitor() 2645 2661 { 2646 if (!m_wheelEventTestMonitor) {2662 if (!m_wheelEventTestMonitor) 2647 2663 m_wheelEventTestMonitor = adoptRef(new WheelEventTestMonitor(*this)); 2648 // We need to update the scrolling coordinator so that the mainframe scrolling node can expect wheel event test triggers.2649 if (auto* frameView = mainFrame().view()) {2650 if (m_scrollingCoordinator) {2651 m_scrollingCoordinator->startMonitoringWheelEvents();2652 m_scrollingCoordinator->updateIsMonitoringWheelEventsForFrameView(*frameView);2653 }2654 }2655 }2656 2664 2657 2665 return *m_wheelEventTestMonitor; -
trunk/Source/WebCore/page/Page.h
r259523 r259820 653 653 654 654 WEBCORE_EXPORT RefPtr<WheelEventTestMonitor> wheelEventTestMonitor() const; 655 WEBCORE_EXPORT WheelEventTestMonitor& ensureWheelEventTestMonitor();656 655 WEBCORE_EXPORT void clearWheelEventTestMonitor(); 656 WEBCORE_EXPORT void startMonitoringWheelEvents(); 657 657 WEBCORE_EXPORT bool isMonitoringWheelEvents() const; 658 658 … … 778 778 779 779 void doAfterUpdateRendering(); 780 781 WheelEventTestMonitor& ensureWheelEventTestMonitor(); 780 782 781 783 const std::unique_ptr<Chrome> m_chrome; -
trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
r258679 r259820 139 139 void ScrollingCoordinatorMac::startMonitoringWheelEvents() 140 140 { 141 scrollingTree()->clearLatchedNode(); 141 142 auto monitor = m_page->wheelEventTestMonitor(); 142 143 scrollingTree()->setWheelEventTestMonitor(WTFMove(monitor)); -
trunk/Source/WebCore/testing/js/WebCoreTestSupport.cpp
r258679 r259820 86 86 return; 87 87 88 page-> ensureWheelEventTestMonitor().clearAllTestDeferrals();88 page->startMonitoringWheelEvents(); 89 89 } 90 90 … … 96 96 97 97 JSValueProtect(context, jsCallbackFunction); 98 99 page->ensureWheelEventTestMonitor().setTestCallbackAndStartMonitoring(expectWheelEndOrCancel, expectMomentumEnd, [=](void) { 100 JSObjectCallAsFunction(context, jsCallbackFunction, nullptr, 0, nullptr, nullptr); 101 JSValueUnprotect(context, jsCallbackFunction); 102 }); 98 99 if (auto wheelEventTestMonitor = page->wheelEventTestMonitor()) { 100 wheelEventTestMonitor->setTestCallbackAndStartMonitoring(expectWheelEndOrCancel, expectMomentumEnd, [=](void) { 101 JSObjectCallAsFunction(context, jsCallbackFunction, nullptr, 0, nullptr, nullptr); 102 JSValueUnprotect(context, jsCallbackFunction); 103 }); 104 } 103 105 } 104 106 -
trunk/Source/WebKit/ChangeLog
r259818 r259820 1 2020-04-09 Simon Fraser <simon.fraser@apple.com> 2 3 eventSender.monitorWheelEvents() should clear latching state 4 https://bugs.webkit.org/show_bug.cgi?id=210288 5 6 Reviewed by Tim Horton. 7 8 Use monitorWheelEvents() as a trigger to clear scroll latching state, both main-thread (via Page) 9 and scrolling thread (via ScrollingTree). 10 11 Page::ensureWheelEventTestMonitor() had side-effects, so hide it, and have clients explicitly call Page::startMonitoringWheelEvents(). 12 13 * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: 14 (WKBundlePageStartMonitoringScrollOperations): 15 (WKBundlePageRegisterScrollOperationCompletionCallback): 16 1 17 2020-04-09 Simon Fraser <simon.fraser@apple.com> 2 18 -
trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
r259159 r259820 703 703 return; 704 704 705 page-> ensureWheelEventTestMonitor().clearAllTestDeferrals();705 page->startMonitoringWheelEvents(); 706 706 } 707 707 … … 716 716 return false; 717 717 718 page->ensureWheelEventTestMonitor().setTestCallbackAndStartMonitoring(expectWheelEndOrCancel, expectMomentumEnd, [=]() { 719 callback(context); 720 }); 718 if (auto wheelEventTestMonitor = page->wheelEventTestMonitor()) { 719 wheelEventTestMonitor->setTestCallbackAndStartMonitoring(expectWheelEndOrCancel, expectMomentumEnd, [=]() { 720 callback(context); 721 }); 722 } 721 723 return true; 722 724 }
Note:
See TracChangeset
for help on using the changeset viewer.