Rename WheelEventTestTrigger and improve naming in related code
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Oct 2019 00:24:44 +0000 (00:24 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Oct 2019 00:24:44 +0000 (00:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=202772

Reviewed by Tim Horton.

Change the "test trigger" terminology to "monitor wheel events"; after all, tests
call monitorWheelEvents() and callAfterScrollingCompletes(), and this is not triggering
a test.

Source/WebCore:

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/FrameView.cpp:
(WebCore::FrameView::adjustScrollbarsForLayout):
(WebCore::FrameView::setScrollPosition):
(WebCore::FrameView::didAddScrollbar):
* page/Page.cpp:
(WebCore::Page::ensureWheelEventTestMonitor):
(WebCore::Page::ensureTestTrigger): Deleted.
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::testTrigger const): Deleted.
(WebCore::Page::clearTrigger): Deleted.
(WebCore::Page::expectsWheelEventTriggers const): Deleted.
* page/WheelEventTestMonitor.cpp: Added.
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::triggerTestTimerFired):
(WebCore::operator<<):
* page/WheelEventTestMonitor.h: Renamed from Source/WebCore/page/WheelEventTestTrigger.h.
* page/WheelEventTestTrigger.cpp: Removed.
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::platformPrepareForWheelEvents):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::updateIsMonitoringWheelEventsForFrameView):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const):
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const):
(WebCore::AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView): Deleted.
(WebCore::AsyncScrollingCoordinator::deferTestsForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeTestDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::updateIsMonitoringWheelEventsForFrameView):
(WebCore::ScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView): Deleted.
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach):
(WebCore::ScrollingStateScrollingNode::setIsMonitoringWheelEvents):
(WebCore::ScrollingStateScrollingNode::dumpProperties const):
(WebCore::ScrollingStateScrollingNode::setExpectsWheelEventTestTrigger): Deleted.
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::ScrollingStateScrollingNode::isMonitoringWheelEvents const):
(WebCore::ScrollingStateScrollingNode::expectsWheelEventTestTrigger const): Deleted.
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::deferWheelEventTestCompletionForReason):
(WebCore::ScrollingTree::removeWheelEventTestCompletionDeferralForReason):
(WebCore::ScrollingTree::deferTestsForReason): Deleted.
(WebCore::ScrollingTree::removeTestDeferralForReason): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason):
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason):
(WebCore::ThreadedScrollingTree::deferTestsForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeTestDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferTestsForReason const): Deleted.
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeTestDeferralForReason const): Deleted.
* platform/Logging.h:
* platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollAnimator::removeWheelEventTestCompletionDeferralForReason const):
(WebCore::ScrollAnimator::deferTestsForReason const): Deleted.
(WebCore::ScrollAnimator::removeTestDeferralForReason const): Deleted.
* platform/ScrollAnimator.h:
(WebCore::ScrollAnimator::ScrollAnimator::setWheelEventTestMonitor):
(WebCore::ScrollAnimator::ScrollAnimator::setWheelEventTestTrigger): Deleted.
* platform/cocoa/ScrollController.h:
(WebCore::ScrollControllerClient::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollControllerClient::removeWheelEventTestCompletionDeferralForReason const):
(WebCore::ScrollControllerClient::deferTestsForReason const): Deleted.
(WebCore::ScrollControllerClient::removeTestDeferralForReason const): Deleted.
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::startSnapRubberbandTimer):
(WebCore::ScrollController::stopSnapRubberbandTimer):
(WebCore::ScrollController::scheduleStatelessScrollSnap):
(WebCore::ScrollController::startDeferringWheelEventTestCompletionDueToScrollSnapping):
(WebCore::ScrollController::stopDeferringWheelEventTestCompletionDueToScrollSnapping):
(WebCore::ScrollController::startScrollSnapTimer):
(WebCore::ScrollController::stopScrollSnapTimer):
(WebCore::ScrollController::startDeferringTestsDueToScrollSnapping): Deleted.
(WebCore::ScrollController::stopDeferringTestsDueToScrollSnapping): Deleted.
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::didBeginScrollGesture const):
(WebCore::ScrollAnimatorMac::didEndScrollGesture const):
(WebCore::ScrollAnimatorMac::sendContentAreaScrolledSoon):
(WebCore::ScrollAnimatorMac::sendContentAreaScrolledTimerFired):
* rendering/RenderBox.cpp:
(WebCore::setupWheelEventMonitor):
(WebCore::RenderBox::setScrollLeft):
(WebCore::RenderBox::setScrollTop):
(WebCore::setupWheelEventTestTrigger): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::createScrollbar):
* rendering/RenderListBox.cpp:
(WebCore::setupWheelEventTestMonitor):
(WebCore::RenderListBox::setScrollTop):
(WebCore::RenderListBox::createScrollbar):
(WebCore::setupWheelEventTestTrigger): Deleted.
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::monitorWheelEvents):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer):
(WebCoreTestSupport::clearWheelEventTestMonitor):
(WebCoreTestSupport::clearWheelEventTestTrigger): Deleted.
* testing/js/WebCoreTestSupport.h:

Source/WebKit:

* UIProcess/API/C/WKPage.cpp:
(WKPageClearWheelEventTestMonitor):
(WKPageClearWheelEventTestTrigger): Deleted.
* UIProcess/API/C/WKPage.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::clearWheelEventTestMonitor):
(WebKit::WebPageProxy::clearWheelEventTestTrigger): Deleted.
* UIProcess/WebPageProxy.h:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageStartMonitoringScrollOperations):
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::createScrollbar):
* WebProcess/WebPage/EventDispatcher.cpp:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::clearWheelEventTestMonitor):
(WebKit::WebPage::clearWheelEventTestTrigger): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebViewToConsistentStateBeforeTesting):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@250946 268f45cc-cd09-0410-ab3c-d52691b4dbfc

48 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Headers.cmake
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/WheelEventTestMonitor.cpp [new file with mode: 0644]
Source/WebCore/page/WheelEventTestMonitor.h [moved from Source/WebCore/page/WheelEventTestTrigger.h with 74% similarity]
Source/WebCore/page/WheelEventTestTrigger.cpp [deleted file]
Source/WebCore/page/mac/EventHandlerMac.mm
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
Source/WebCore/page/scrolling/ScrollingTree.h
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h
Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp
Source/WebCore/page/scrolling/ThreadedScrollingTree.h
Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h
Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm
Source/WebCore/platform/Logging.h
Source/WebCore/platform/ScrollAnimator.cpp
Source/WebCore/platform/ScrollAnimator.h
Source/WebCore/platform/cocoa/ScrollController.h
Source/WebCore/platform/cocoa/ScrollController.mm
Source/WebCore/platform/mac/ScrollAnimatorMac.mm
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/testing/js/WebCoreTestSupport.cpp
Source/WebCore/testing/js/WebCoreTestSupport.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/C/WKPage.cpp
Source/WebKit/UIProcess/API/C/WKPage.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKit/WebProcess/WebPage/WebPage.messages.in
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/WebKitTestRunner/TestController.cpp

index 85e30a3..985784e 100644 (file)
         (WebCore::MockWebAuthenticationConfiguration::decode):
         * testing/MockWebAuthenticationConfiguration.idl: Added.
 
+2019-10-09  Simon Fraser  <simon.fraser@apple.com>
+
+        Rename WheelEventTestTrigger and improve naming in related code
+        https://bugs.webkit.org/show_bug.cgi?id=202772
+
+        Reviewed by Tim Horton.
+
+        Change the "test trigger" terminology to "monitor wheel events"; after all, tests
+        call monitorWheelEvents() and callAfterScrollingCompletes(), and this is not triggering
+        a test.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::adjustScrollbarsForLayout):
+        (WebCore::FrameView::setScrollPosition):
+        (WebCore::FrameView::didAddScrollbar):
+        * page/Page.cpp:
+        (WebCore::Page::ensureWheelEventTestMonitor):
+        (WebCore::Page::ensureTestTrigger): Deleted.
+        * page/Page.h:
+        (WebCore::Page::wheelEventTestMonitor const):
+        (WebCore::Page::clearWheelEventTestMonitor):
+        (WebCore::Page::isMonitoringWheelEvents const):
+        (WebCore::Page::testTrigger const): Deleted.
+        (WebCore::Page::clearTrigger): Deleted.
+        (WebCore::Page::expectsWheelEventTriggers const): Deleted.
+        * page/WheelEventTestMonitor.cpp: Added.
+        (WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
+        (WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
+        (WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer):
+        (WebCore::WheelEventTestMonitor::deferForReason):
+        (WebCore::WheelEventTestMonitor::removeDeferralForReason):
+        (WebCore::WheelEventTestMonitor::triggerTestTimerFired):
+        (WebCore::operator<<):
+        * page/WheelEventTestMonitor.h: Renamed from Source/WebCore/page/WheelEventTestTrigger.h.
+        * page/WheelEventTestTrigger.cpp: Removed.
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::EventHandler::platformPrepareForWheelEvents):
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
+        (WebCore::AsyncScrollingCoordinator::updateIsMonitoringWheelEventsForFrameView):
+        (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
+        (WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const):
+        (WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const):
+        (WebCore::AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView): Deleted.
+        (WebCore::AsyncScrollingCoordinator::deferTestsForReason const): Deleted.
+        (WebCore::AsyncScrollingCoordinator::removeTestDeferralForReason const): Deleted.
+        * page/scrolling/AsyncScrollingCoordinator.h:
+        * page/scrolling/ScrollingCoordinator.h:
+        (WebCore::ScrollingCoordinator::updateIsMonitoringWheelEventsForFrameView):
+        (WebCore::ScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView): Deleted.
+        * page/scrolling/ScrollingStateScrollingNode.cpp:
+        (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
+        (WebCore::ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach):
+        (WebCore::ScrollingStateScrollingNode::setIsMonitoringWheelEvents):
+        (WebCore::ScrollingStateScrollingNode::dumpProperties const):
+        (WebCore::ScrollingStateScrollingNode::setExpectsWheelEventTestTrigger): Deleted.
+        * page/scrolling/ScrollingStateScrollingNode.h:
+        (WebCore::ScrollingStateScrollingNode::isMonitoringWheelEvents const):
+        (WebCore::ScrollingStateScrollingNode::expectsWheelEventTestTrigger const): Deleted.
+        * page/scrolling/ScrollingTree.h:
+        (WebCore::ScrollingTree::deferWheelEventTestCompletionForReason):
+        (WebCore::ScrollingTree::removeWheelEventTestCompletionDeferralForReason):
+        (WebCore::ScrollingTree::deferTestsForReason): Deleted.
+        (WebCore::ScrollingTree::removeTestDeferralForReason): Deleted.
+        * page/scrolling/ScrollingTreeScrollingNode.cpp:
+        (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
+        * page/scrolling/ScrollingTreeScrollingNode.h:
+        * page/scrolling/ThreadedScrollingTree.cpp:
+        (WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason):
+        (WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason):
+        (WebCore::ThreadedScrollingTree::deferTestsForReason): Deleted.
+        (WebCore::ThreadedScrollingTree::removeTestDeferralForReason): Deleted.
+        * page/scrolling/ThreadedScrollingTree.h:
+        * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
+        * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
+        (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
+        (WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
+        (WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
+        (WebCore::ScrollingTreeScrollingNodeDelegateMac::deferTestsForReason const): Deleted.
+        (WebCore::ScrollingTreeScrollingNodeDelegateMac::removeTestDeferralForReason const): Deleted.
+        * platform/Logging.h:
+        * platform/ScrollAnimator.cpp:
+        (WebCore::ScrollAnimator::deferWheelEventTestCompletionForReason const):
+        (WebCore::ScrollAnimator::removeWheelEventTestCompletionDeferralForReason const):
+        (WebCore::ScrollAnimator::deferTestsForReason const): Deleted.
+        (WebCore::ScrollAnimator::removeTestDeferralForReason const): Deleted.
+        * platform/ScrollAnimator.h:
+        (WebCore::ScrollAnimator::ScrollAnimator::setWheelEventTestMonitor):
+        (WebCore::ScrollAnimator::ScrollAnimator::setWheelEventTestTrigger): Deleted.
+        * platform/cocoa/ScrollController.h:
+        (WebCore::ScrollControllerClient::deferWheelEventTestCompletionForReason const):
+        (WebCore::ScrollControllerClient::removeWheelEventTestCompletionDeferralForReason const):
+        (WebCore::ScrollControllerClient::deferTestsForReason const): Deleted.
+        (WebCore::ScrollControllerClient::removeTestDeferralForReason const): Deleted.
+        * platform/cocoa/ScrollController.mm:
+        (WebCore::ScrollController::startSnapRubberbandTimer):
+        (WebCore::ScrollController::stopSnapRubberbandTimer):
+        (WebCore::ScrollController::scheduleStatelessScrollSnap):
+        (WebCore::ScrollController::startDeferringWheelEventTestCompletionDueToScrollSnapping):
+        (WebCore::ScrollController::stopDeferringWheelEventTestCompletionDueToScrollSnapping):
+        (WebCore::ScrollController::startScrollSnapTimer):
+        (WebCore::ScrollController::stopScrollSnapTimer):
+        (WebCore::ScrollController::startDeferringTestsDueToScrollSnapping): Deleted.
+        (WebCore::ScrollController::stopDeferringTestsDueToScrollSnapping): Deleted.
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::ScrollAnimatorMac::didBeginScrollGesture const):
+        (WebCore::ScrollAnimatorMac::didEndScrollGesture const):
+        (WebCore::ScrollAnimatorMac::sendContentAreaScrolledSoon):
+        (WebCore::ScrollAnimatorMac::sendContentAreaScrolledTimerFired):
+        * rendering/RenderBox.cpp:
+        (WebCore::setupWheelEventMonitor):
+        (WebCore::RenderBox::setScrollLeft):
+        (WebCore::RenderBox::setScrollTop):
+        (WebCore::setupWheelEventTestTrigger): Deleted.
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::createScrollbar):
+        * rendering/RenderListBox.cpp:
+        (WebCore::setupWheelEventTestMonitor):
+        (WebCore::RenderListBox::setScrollTop):
+        (WebCore::RenderListBox::createScrollbar):
+        (WebCore::setupWheelEventTestTrigger): Deleted.
+        * testing/js/WebCoreTestSupport.cpp:
+        (WebCoreTestSupport::monitorWheelEvents):
+        (WebCoreTestSupport::setTestCallbackAndStartNotificationTimer):
+        (WebCoreTestSupport::clearWheelEventTestMonitor):
+        (WebCoreTestSupport::clearWheelEventTestTrigger): Deleted.
+        * testing/js/WebCoreTestSupport.h:
+
 2019-10-09  Sihui Liu  <sihui_liu@apple.com>
 
         IndexedDB: update size to actual disk usage only when estimated increase is bigger than space available
index 0d18608..078a566 100644 (file)
@@ -842,7 +842,7 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS
     page/WebCoreKeyboardUIMode.h
     page/WebKitNamespace.h
     page/WheelEventDeltaFilter.h
-    page/WheelEventTestTrigger.h
+    page/WheelEventTestMonitor.h
     page/WindowFeatures.h
 
     page/animation/AnimationBase.h
index 766a790..ae25765 100644 (file)
@@ -1649,7 +1649,7 @@ page/UserContentURLPattern.cpp
 page/VisitedLinkStore.cpp
 page/VisualViewport.cpp
 page/WheelEventDeltaFilter.cpp
-page/WheelEventTestTrigger.cpp
+page/WheelEventTestMonitor.cpp
 page/WindowFeatures.cpp
 page/WindowFocusAllowedIndicator.cpp
 page/WorkerNavigator.cpp
index 538c967..6709bf5 100644 (file)
                7AABA25A14BC613300AA9A11 /* DOMEditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AABA25814BC613300AA9A11 /* DOMEditor.h */; };
                7AAFE8D019CB8672000F56D8 /* ScrollLatchingState.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AAFE8CE19CB8672000F56D8 /* ScrollLatchingState.h */; };
                7ADE722610CBBB9B006B3B3A /* ContextMenuProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               7AE335F21ACB09E200E401EF /* WheelEventTestTrigger.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AE335F01ACB09E200E401EF /* WheelEventTestTrigger.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               7AE335F21ACB09E200E401EF /* WheelEventTestMonitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AE335F01ACB09E200E401EF /* WheelEventTestMonitor.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7AE6C93C1BE0C60100E19E03 /* MainThreadSharedTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AE6C93A1BE0C60100E19E03 /* MainThreadSharedTimer.h */; };
                7AF9B20218CFB2DF00C64BEF /* VTTRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AF9B1FC18CFB2DF00C64BEF /* VTTRegion.cpp */; };
                7AF9B20318CFB2DF00C64BEF /* VTTRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AF9B1FD18CFB2DF00C64BEF /* VTTRegion.h */; };
                7AAFE8CD19CB8672000F56D8 /* ScrollLatchingState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollLatchingState.cpp; sourceTree = "<group>"; };
                7AAFE8CE19CB8672000F56D8 /* ScrollLatchingState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollLatchingState.h; sourceTree = "<group>"; };
                7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextMenuProvider.h; sourceTree = "<group>"; };
-               7AE335EF1ACB09E200E401EF /* WheelEventTestTrigger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WheelEventTestTrigger.cpp; sourceTree = "<group>"; };
-               7AE335F01ACB09E200E401EF /* WheelEventTestTrigger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WheelEventTestTrigger.h; sourceTree = "<group>"; };
+               7AE335EF1ACB09E200E401EF /* WheelEventTestMonitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WheelEventTestMonitor.cpp; sourceTree = "<group>"; };
+               7AE335F01ACB09E200E401EF /* WheelEventTestMonitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WheelEventTestMonitor.h; sourceTree = "<group>"; };
                7AE6C9371BE0C5C800E19E03 /* MainThreadSharedTimerCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainThreadSharedTimerCF.cpp; sourceTree = "<group>"; };
                7AE6C9391BE0C60100E19E03 /* MainThreadSharedTimer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainThreadSharedTimer.cpp; sourceTree = "<group>"; };
                7AE6C93A1BE0C60100E19E03 /* MainThreadSharedTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainThreadSharedTimer.h; sourceTree = "<group>"; };
                                494BD7940F55C8EE00747828 /* WebKitPoint.idl */,
                                2E19516A1B6598D200DF6EEF /* WheelEventDeltaFilter.cpp */,
                                2EBBC3D71B65988300F5253D /* WheelEventDeltaFilter.h */,
-                               7AE335EF1ACB09E200E401EF /* WheelEventTestTrigger.cpp */,
-                               7AE335F01ACB09E200E401EF /* WheelEventTestTrigger.h */,
+                               7AE335EF1ACB09E200E401EF /* WheelEventTestMonitor.cpp */,
+                               7AE335F01ACB09E200E401EF /* WheelEventTestMonitor.h */,
                                7C4189AC1B07CBF2000FA757 /* WindowEventHandlers.idl */,
                                BC8243E60D0CFD7500460C8F /* WindowFeatures.cpp */,
                                BC8243E70D0CFD7500460C8F /* WindowFeatures.h */,
                                85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */,
                                2EBBC3D81B65988300F5253D /* WheelEventDeltaFilter.h in Headers */,
                                2E9B5D8F1B66A94E008C6A24 /* WheelEventDeltaFilterMac.h in Headers */,
-                               7AE335F21ACB09E200E401EF /* WheelEventTestTrigger.h in Headers */,
+                               7AE335F21ACB09E200E401EF /* WheelEventTestMonitor.h in Headers */,
                                A1956F252331AD530057E9D2 /* WHLSLFunctionDefinition.h in Headers */,
                                A1956F242331AD210057E9D2 /* WHLSLProgram.h in Headers */,
                                A1956F232331ACF20057E9D2 /* WHLSLReplaceWith.h in Headers */,
index d72ba7e..b0a3e56 100644 (file)
 #include "TiledBacking.h"
 #include "VelocityData.h"
 #include "VisualViewport.h"
-#include "WheelEventTestTrigger.h"
+#include "WheelEventTestMonitor.h"
 #include <wtf/text/TextStream.h>
 
 #include <wtf/IsoMallocInlines.h>
@@ -1196,8 +1196,8 @@ void FrameView::adjustScrollbarsForLayout(bool isFirstLayout)
         if (hMode == ScrollbarAuto)
             setHorizontalScrollbarMode(ScrollbarAlwaysOff); // This causes a horizontal scrollbar to disappear.
         ASSERT(frame().page());
-        if (frame().page()->expectsWheelEventTriggers())
-            scrollAnimator().setWheelEventTestTrigger(frame().page()->testTrigger());
+        if (frame().page()->isMonitoringWheelEvents())
+            scrollAnimator().setWheelEventTestMonitor(frame().page()->wheelEventTestMonitor());
         setScrollbarModes(hMode, vMode);
         setScrollbarsSuppressed(false, true);
     } else if (hMode != horizontalScrollbarMode() || vMode != verticalScrollbarMode())
@@ -2238,8 +2238,8 @@ void FrameView::setScrollPosition(const ScrollPosition& scrollPosition)
     m_shouldScrollToFocusedElement = false;
     m_delayedScrollToFocusedElementTimer.stop();
     Page* page = frame().page();
-    if (page && page->expectsWheelEventTriggers())
-        scrollAnimator().setWheelEventTestTrigger(page->testTrigger());
+    if (page && page->isMonitoringWheelEvents())
+        scrollAnimator().setWheelEventTestMonitor(page->wheelEventTestMonitor());
     ScrollView::setScrollPosition(scrollPosition);
 
     setCurrentScrollType(oldScrollType);
@@ -5061,8 +5061,8 @@ void FrameView::didAddScrollbar(Scrollbar* scrollbar, ScrollbarOrientation orien
 {
     ScrollableArea::didAddScrollbar(scrollbar, orientation);
     Page* page = frame().page();
-    if (page && page->expectsWheelEventTriggers())
-        scrollAnimator().setWheelEventTestTrigger(page->testTrigger());
+    if (page && page->isMonitoringWheelEvents())
+        scrollAnimator().setWheelEventTestMonitor(page->wheelEventTestMonitor());
     if (AXObjectCache* cache = axObjectCache())
         cache->handleScrollbarUpdate(this);
 }
index 74697c9..bd8c661 100644 (file)
@@ -2569,18 +2569,18 @@ void Page::setShouldPlayToPlaybackTarget(uint64_t clientId, bool shouldPlay)
 }
 #endif
 
-WheelEventTestTrigger& Page::ensureTestTrigger()
+WheelEventTestMonitor& Page::ensureWheelEventTestMonitor()
 {
-    if (!m_testTrigger) {
-        m_testTrigger = adoptRef(new WheelEventTestTrigger());
+    if (!m_wheelEventTestMonitor) {
+        m_wheelEventTestMonitor = adoptRef(new WheelEventTestMonitor());
         // We need to update the scrolling coordinator so that the mainframe scrolling node can expect wheel event test triggers.
         if (auto* frameView = mainFrame().view()) {
             if (m_scrollingCoordinator)
-                m_scrollingCoordinator->updateExpectsWheelEventTestTriggerWithFrameView(*frameView);
+                m_scrollingCoordinator->updateIsMonitoringWheelEventsForFrameView(*frameView);
         }
     }
 
-    return *m_testTrigger;
+    return *m_wheelEventTestMonitor;
 }
 
 #if ENABLE(VIDEO)
index 269e6fd..3c11c60 100644 (file)
@@ -40,7 +40,7 @@
 #include "UserInterfaceLayoutDirection.h"
 #include "ViewportArguments.h"
 #include "VisibilityState.h"
-#include "WheelEventTestTrigger.h"
+#include "WheelEventTestMonitor.h"
 #include <memory>
 #include <pal/SessionID.h>
 #include <wtf/Assertions.h>
@@ -644,10 +644,10 @@ public:
     WEBCORE_EXPORT void setShouldPlayToPlaybackTarget(uint64_t, bool);
 #endif
 
-    RefPtr<WheelEventTestTrigger> testTrigger() const { return m_testTrigger; }
-    WEBCORE_EXPORT WheelEventTestTrigger& ensureTestTrigger();
-    void clearTrigger() { m_testTrigger = nullptr; }
-    bool expectsWheelEventTriggers() const { return !!m_testTrigger; }
+    RefPtr<WheelEventTestMonitor> wheelEventTestMonitor() const { return m_wheelEventTestMonitor; }
+    WEBCORE_EXPORT WheelEventTestMonitor& ensureWheelEventTestMonitor();
+    void clearWheelEventTestMonitor() { m_wheelEventTestMonitor = nullptr; }
+    bool isMonitoringWheelEvents() const { return !!m_wheelEventTestMonitor; }
 
     void setIsForSanitizingWebContent() { m_isForSanitizingWebContent = true; }
     bool isForSanitizingWebContent() const { return m_isForSanitizingWebContent; }
@@ -926,7 +926,7 @@ private:
     Ref<StorageNamespaceProvider> m_storageNamespaceProvider;
     Ref<UserContentProvider> m_userContentProvider;
     Ref<VisitedLinkStore> m_visitedLinkStore;
-    RefPtr<WheelEventTestTrigger> m_testTrigger;
+    RefPtr<WheelEventTestMonitor> m_wheelEventTestMonitor;
 
     HashSet<ActivityStateChangeObserver*> m_activityStateChangeObservers;
 
diff --git a/Source/WebCore/page/WheelEventTestMonitor.cpp b/Source/WebCore/page/WheelEventTestMonitor.cpp
new file mode 100644 (file)
index 0000000..061ff11
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * Copyright (C) 2015-2019 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WheelEventTestMonitor.h"
+
+#include "Logging.h"
+#include <wtf/text/TextStream.h>
+
+#if !LOG_DISABLED
+#include <wtf/text/CString.h>
+#include <wtf/text/StringBuilder.h>
+#endif
+
+namespace WebCore {
+
+WheelEventTestMonitor::WheelEventTestMonitor()
+    : m_testForCompletionTimer(RunLoop::current(), this, &WheelEventTestMonitor::triggerTestTimerFired)
+{
+}
+
+void WheelEventTestMonitor::clearAllTestDeferrals()
+{
+    std::lock_guard<Lock> lock(m_reasonsLock);
+    m_deferCompletionReasons.clear();
+    m_completionCallback = nullptr;
+    m_testForCompletionTimer.stop();
+    LOG_WITH_STREAM(WheelEventTestMonitor, stream << "      (=) WheelEventTestMonitor::clearAllTestDeferrals: cleared all test state.");
+}
+
+void WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer(WTF::Function<void()>&& functionCallback)
+{
+    {
+        std::lock_guard<Lock> lock(m_reasonsLock);
+        m_completionCallback = WTFMove(functionCallback);
+    }
+    
+    if (!m_testForCompletionTimer.isActive())
+        m_testForCompletionTimer.startRepeating(1_s / 60.);
+}
+
+void WheelEventTestMonitor::deferForReason(ScrollableAreaIdentifier identifier, DeferReason reason)
+{
+    std::lock_guard<Lock> lock(m_reasonsLock);
+    m_deferCompletionReasons.ensure(identifier, [] {
+        return OptionSet<DeferReason>();
+    }).iterator->value.add(reason);
+    
+    LOG_WITH_STREAM(WheelEventTestMonitor, stream << "      (=) WheelEventTestMonitor::deferForReason: id=" << identifier << ", reason=" << reason);
+}
+
+void WheelEventTestMonitor::removeDeferralForReason(ScrollableAreaIdentifier identifier, DeferReason reason)
+{
+    std::lock_guard<Lock> lock(m_reasonsLock);
+    auto it = m_deferCompletionReasons.find(identifier);
+    if (it == m_deferCompletionReasons.end())
+        return;
+
+    LOG_WITH_STREAM(WheelEventTestMonitor, stream << "      (=) WheelEventTestMonitor::removeDeferralForReason: id=" << identifier << ", reason=" << reason);
+    it->value.remove(reason);
+    
+    if (it->value.isEmpty())
+        m_deferCompletionReasons.remove(it);
+}
+    
+void WheelEventTestMonitor::triggerTestTimerFired()
+{
+    WTF::Function<void()> functionCallback;
+
+    {
+        std::lock_guard<Lock> lock(m_reasonsLock);
+        if (!m_deferCompletionReasons.isEmpty()) {
+            LOG_WITH_STREAM(WheelEventTestMonitor, stream << "  WheelEventTestMonitor::triggerTestTimerFired - scrolling still active, reasons " << m_deferCompletionReasons);
+            return;
+        }
+
+        functionCallback = WTFMove(m_completionCallback);
+    }
+
+    m_testForCompletionTimer.stop();
+
+    LOG_WITH_STREAM(WheelEventTestMonitor, stream << "  WheelEventTestMonitor::triggerTestTimerFired: scrolling is idle, FIRING TEST");
+    if (functionCallback)
+        functionCallback();
+}
+
+TextStream& operator<<(TextStream& ts, WheelEventTestMonitor::DeferReason reason)
+{
+    switch (reason) {
+    case WheelEventTestMonitor::RubberbandInProgress: ts << "rubberbanding"; break;
+    case WheelEventTestMonitor::ScrollSnapInProgress: ts << "scroll-snapping"; break;
+    case WheelEventTestMonitor::ScrollingThreadSyncNeeded: ts << "scrolling thread sync needed"; break;
+    case WheelEventTestMonitor::ContentScrollInProgress: ts << "content scrolling"; break;
+    }
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const WheelEventTestMonitor::ScrollableAreaReasonMap& reasonMap)
+{
+    for (const auto& regionReasonsPair : reasonMap)
+        ts << "   scroll region: " << regionReasonsPair.key << " reasons: " << regionReasonsPair.value;
+
+    return ts;
+}
+
+} // namespace WebCore
similarity index 74%
rename from Source/WebCore/page/WheelEventTestTrigger.h
rename to Source/WebCore/page/WheelEventTestMonitor.h
index c13db97..0cdce5c 100644 (file)
 
 namespace WebCore {
 
-class WheelEventTestTrigger : public ThreadSafeRefCounted<WheelEventTestTrigger> {
-    WTF_MAKE_NONCOPYABLE(WheelEventTestTrigger); WTF_MAKE_FAST_ALLOCATED;
+class WheelEventTestMonitor : public ThreadSafeRefCounted<WheelEventTestMonitor> {
+    WTF_MAKE_NONCOPYABLE(WheelEventTestMonitor); WTF_MAKE_FAST_ALLOCATED;
 public:
-    WheelEventTestTrigger();
+    WheelEventTestMonitor();
 
     WEBCORE_EXPORT void setTestCallbackAndStartNotificationTimer(WTF::Function<void()>&&);
     WEBCORE_EXPORT void clearAllTestDeferrals();
     
-    enum DeferTestTriggerReason {
+    enum DeferReason {
         RubberbandInProgress        = 1 << 0,
         ScrollSnapInProgress        = 1 << 1,
         ScrollingThreadSyncNeeded   = 1 << 2,
@@ -54,22 +54,22 @@ public:
     };
     typedef const void* ScrollableAreaIdentifier;
 
-    WEBCORE_EXPORT void deferTestsForReason(ScrollableAreaIdentifier, DeferTestTriggerReason);
-    WEBCORE_EXPORT void removeTestDeferralForReason(ScrollableAreaIdentifier, DeferTestTriggerReason);
+    WEBCORE_EXPORT void deferForReason(ScrollableAreaIdentifier, DeferReason);
+    WEBCORE_EXPORT void removeDeferralForReason(ScrollableAreaIdentifier, DeferReason);
     
     void triggerTestTimerFired();
 
-    using ScrollableAreaReasonMap = WTF::HashMap<ScrollableAreaIdentifier, OptionSet<DeferTestTriggerReason>>;
+    using ScrollableAreaReasonMap = WTF::HashMap<ScrollableAreaIdentifier, OptionSet<DeferReason>>;
 
 private:
-    WTF::Function<void()> m_testNotificationCallback;
-    RunLoop::Timer<WheelEventTestTrigger> m_testTriggerTimer;
-    mutable Lock m_testTriggerMutex;
-    
-    ScrollableAreaReasonMap m_deferTestTriggerReasons;
+    WTF::Function<void()> m_completionCallback;
+    RunLoop::Timer<WheelEventTestMonitor> m_testForCompletionTimer;
+
+    mutable Lock m_reasonsLock;
+    ScrollableAreaReasonMap m_deferCompletionReasons;
 };
 
-WTF::TextStream& operator<<(WTF::TextStream&, WheelEventTestTrigger::DeferTestTriggerReason);
-WTF::TextStream& operator<<(WTF::TextStream&, const WheelEventTestTrigger::ScrollableAreaReasonMap&);
+WTF::TextStream& operator<<(WTF::TextStream&, WheelEventTestMonitor::DeferReason);
+WTF::TextStream& operator<<(WTF::TextStream&, const WheelEventTestMonitor::ScrollableAreaReasonMap&);
 
 } // namespace WebCore
diff --git a/Source/WebCore/page/WheelEventTestTrigger.cpp b/Source/WebCore/page/WheelEventTestTrigger.cpp
deleted file mode 100644 (file)
index ad71d8f..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (C) 2015-2019 Apple Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WheelEventTestTrigger.h"
-
-#include "Logging.h"
-#include <wtf/text/TextStream.h>
-
-#if !LOG_DISABLED
-#include <wtf/text/CString.h>
-#include <wtf/text/StringBuilder.h>
-#endif
-
-namespace WebCore {
-
-WheelEventTestTrigger::WheelEventTestTrigger()
-    : m_testTriggerTimer(RunLoop::current(), this, &WheelEventTestTrigger::triggerTestTimerFired)
-{
-}
-
-void WheelEventTestTrigger::clearAllTestDeferrals()
-{
-    std::lock_guard<Lock> lock(m_testTriggerMutex);
-    m_deferTestTriggerReasons.clear();
-    m_testNotificationCallback = nullptr;
-    m_testTriggerTimer.stop();
-    LOG_WITH_STREAM(WheelEventTestTriggers, stream << "      (=) WheelEventTestTrigger::clearAllTestDeferrals: cleared all test state.");
-}
-
-void WheelEventTestTrigger::setTestCallbackAndStartNotificationTimer(WTF::Function<void()>&& functionCallback)
-{
-    {
-        std::lock_guard<Lock> lock(m_testTriggerMutex);
-        m_testNotificationCallback = WTFMove(functionCallback);
-    }
-    
-    if (!m_testTriggerTimer.isActive())
-        m_testTriggerTimer.startRepeating(1_s / 60.);
-}
-
-void WheelEventTestTrigger::deferTestsForReason(ScrollableAreaIdentifier identifier, DeferTestTriggerReason reason)
-{
-    std::lock_guard<Lock> lock(m_testTriggerMutex);
-    m_deferTestTriggerReasons.ensure(identifier, [] {
-        return OptionSet<DeferTestTriggerReason>();
-    }).iterator->value.add(reason);
-    
-    LOG_WITH_STREAM(WheelEventTestTriggers, stream << "      (=) WheelEventTestTrigger::deferTestsForReason: id=" << identifier << ", reason=" << reason);
-}
-
-void WheelEventTestTrigger::removeTestDeferralForReason(ScrollableAreaIdentifier identifier, DeferTestTriggerReason reason)
-{
-    std::lock_guard<Lock> lock(m_testTriggerMutex);
-    auto it = m_deferTestTriggerReasons.find(identifier);
-    if (it == m_deferTestTriggerReasons.end())
-        return;
-
-    LOG_WITH_STREAM(WheelEventTestTriggers, stream << "      (=) WheelEventTestTrigger::removeTestDeferralForReason: id=" << identifier << ", reason=" << reason);
-    it->value.remove(reason);
-    
-    if (it->value.isEmpty())
-        m_deferTestTriggerReasons.remove(it);
-}
-    
-void WheelEventTestTrigger::triggerTestTimerFired()
-{
-    WTF::Function<void()> functionCallback;
-
-    {
-        std::lock_guard<Lock> lock(m_testTriggerMutex);
-        if (!m_deferTestTriggerReasons.isEmpty()) {
-            LOG_WITH_STREAM(WheelEventTestTriggers, stream << "  WheelEventTestTrigger::triggerTestTimerFired - scrolling still active, reasons " << m_deferTestTriggerReasons);
-            return;
-        }
-
-        functionCallback = WTFMove(m_testNotificationCallback);
-    }
-
-    m_testTriggerTimer.stop();
-
-    LOG_WITH_STREAM(WheelEventTestTriggers, stream << "  WheelEventTestTrigger::triggerTestTimerFired: scrolling is idle, FIRING TEST");
-    if (functionCallback)
-        functionCallback();
-}
-
-TextStream& operator<<(TextStream& ts, WheelEventTestTrigger::DeferTestTriggerReason reason)
-{
-    switch (reason) {
-    case WheelEventTestTrigger::RubberbandInProgress: ts << "rubberbanding"; break;
-    case WheelEventTestTrigger::ScrollSnapInProgress: ts << "scroll-snapping"; break;
-    case WheelEventTestTrigger::ScrollingThreadSyncNeeded: ts << "scrolling thread sync needed"; break;
-    case WheelEventTestTrigger::ContentScrollInProgress: ts << "content scrolling"; break;
-    }
-    return ts;
-}
-
-TextStream& operator<<(TextStream& ts, const WheelEventTestTrigger::ScrollableAreaReasonMap& reasonMap)
-{
-    for (const auto& regionReasonsPair : reasonMap)
-        ts << "   scroll region: " << regionReasonsPair.key << " reasons: " << regionReasonsPair.value;
-
-    return ts;
-}
-
-} // namespace WebCore
index c0d4c25..3f981dd 100644 (file)
@@ -64,7 +64,7 @@
 #include "Settings.h"
 #include "ShadowRoot.h"
 #include "WheelEventDeltaFilter.h"
-#include "WheelEventTestTrigger.h"
+#include "WheelEventTestMonitor.h"
 #include <wtf/BlockObjCExceptions.h>
 #include <wtf/MainThread.h>
 #include <wtf/NeverDestroyed.h>
@@ -956,8 +956,8 @@ void EventHandler::platformPrepareForWheelEvents(const PlatformWheelEvent& wheel
     }
     
     Page* page = m_frame.page();
-    if (scrollableArea && page && page->expectsWheelEventTriggers())
-        scrollableArea->scrollAnimator().setWheelEventTestTrigger(page->testTrigger());
+    if (scrollableArea && page && page->isMonitoringWheelEvents())
+        scrollableArea->scrollAnimator().setWheelEventTestMonitor(page->wheelEventTestMonitor());
 
     ScrollLatchingState* latchingState = page ? page->latchingState() : nullptr;
     if (wheelEvent.shouldConsiderLatching()) {
index 531d3da..5f0a976 100644 (file)
@@ -50,7 +50,7 @@
 #include "ScrollingStateStickyNode.h"
 #include "ScrollingStateTree.h"
 #include "Settings.h"
-#include "WheelEventTestTrigger.h"
+#include "WheelEventTestMonitor.h"
 #include <wtf/ProcessID.h>
 #include <wtf/text/TextStream.h>
 
@@ -137,15 +137,15 @@ void AsyncScrollingCoordinator::frameViewLayoutUpdated(FrameView& frameView)
         return;
 
     auto* page = frameView.frame().page();
-    if (page && page->expectsWheelEventTriggers()) {
-        LOG_WITH_STREAM(WheelEventTestTriggers, stream << "    AsyncScrollingCoordinator::frameViewLayoutUpdated: Expects wheel event test trigger: " << page->expectsWheelEventTriggers());
+    if (page && page->isMonitoringWheelEvents()) {
+        LOG_WITH_STREAM(WheelEventTestMonitor, stream << "    AsyncScrollingCoordinator::frameViewLayoutUpdated: Expects wheel event test trigger: " << page->isMonitoringWheelEvents());
 
         auto* node = m_scrollingStateTree->stateNodeForID(frameView.scrollingNodeID());
         if (!is<ScrollingStateFrameScrollingNode>(node))
             return;
 
         auto& frameScrollingNode = downcast<ScrollingStateFrameScrollingNode>(*node);
-        frameScrollingNode.setExpectsWheelEventTestTrigger(page->expectsWheelEventTriggers());
+        frameScrollingNode.setIsMonitoringWheelEvents(page->isMonitoringWheelEvents());
     }
 #else
     UNUSED_PARAM(frameView);
@@ -175,7 +175,7 @@ void AsyncScrollingCoordinator::frameViewVisualViewportChanged(FrameView& frameV
     frameScrollingNode.setVisualViewportIsSmallerThanLayoutViewport(visualViewportIsSmallerThanLayoutViewport(frameView));
 }
 
-void AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView(const FrameView& frameView)
+void AsyncScrollingCoordinator::updateIsMonitoringWheelEventsForFrameView(const FrameView& frameView)
 {
     auto* page = frameView.frame().page();
     if (!page)
@@ -185,7 +185,7 @@ void AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView(
     if (!node)
         return;
 
-    node->setExpectsWheelEventTestTrigger(page->expectsWheelEventTriggers());
+    node->setIsMonitoringWheelEvents(page->isMonitoringWheelEvents());
 }
 
 void AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged(FrameView& frameView)
@@ -352,10 +352,10 @@ void AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll(ScrollingNo
         reconcileScrollingState(frameView, scrollPosition, layoutViewportOrigin, scrollType, ViewportRectStability::Stable, scrollingLayerPositionAction);
 
 #if PLATFORM(COCOA)
-        if (m_page->expectsWheelEventTriggers()) {
-            frameView.scrollAnimator().setWheelEventTestTrigger(m_page->testTrigger());
-            if (const auto& trigger = m_page->testTrigger())
-                trigger->removeTestDeferralForReason(reinterpret_cast<WheelEventTestTrigger::ScrollableAreaIdentifier>(scrollingNodeID), WheelEventTestTrigger::ScrollingThreadSyncNeeded);
+        if (m_page->isMonitoringWheelEvents()) {
+            frameView.scrollAnimator().setWheelEventTestMonitor(m_page->wheelEventTestMonitor());
+            if (const auto& monitor = m_page->wheelEventTestMonitor())
+                monitor->removeDeferralForReason(reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(scrollingNodeID), WheelEventTestMonitor::ScrollingThreadSyncNeeded);
         }
 #endif
         
@@ -373,10 +373,10 @@ void AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll(ScrollingNo
             m_page->editorClient().overflowScrollPositionChanged();
 
 #if PLATFORM(COCOA)
-        if (m_page->expectsWheelEventTriggers()) {
-            frameView.scrollAnimator().setWheelEventTestTrigger(m_page->testTrigger());
-            if (const auto& trigger = m_page->testTrigger())
-                trigger->removeTestDeferralForReason(reinterpret_cast<WheelEventTestTrigger::ScrollableAreaIdentifier>(scrollingNodeID), WheelEventTestTrigger::ScrollingThreadSyncNeeded);
+        if (m_page->isMonitoringWheelEvents()) {
+            frameView.scrollAnimator().setWheelEventTestMonitor(m_page->wheelEventTestMonitor());
+            if (const auto& monitor = m_page->wheelEventTestMonitor())
+                monitor->removeDeferralForReason(reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(scrollingNodeID), WheelEventTestMonitor::ScrollingThreadSyncNeeded);
         }
 #endif
     }
@@ -854,27 +854,27 @@ void AsyncScrollingCoordinator::setActiveScrollSnapIndices(ScrollingNodeID scrol
     }
 }
 
-void AsyncScrollingCoordinator::deferTestsForReason(WheelEventTestTrigger::ScrollableAreaIdentifier identifier, WheelEventTestTrigger::DeferTestTriggerReason reason) const
+void AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason(WheelEventTestMonitor::ScrollableAreaIdentifier identifier, WheelEventTestMonitor::DeferReason reason) const
 {
     ASSERT(isMainThread());
-    if (!m_page || !m_page->expectsWheelEventTriggers())
+    if (!m_page || !m_page->isMonitoringWheelEvents())
         return;
 
-    if (const auto& trigger = m_page->testTrigger()) {
-        LOG_WITH_STREAM(WheelEventTestTriggers, stream << "    (!) AsyncScrollingCoordinator::deferTestsForReason: Deferring " << identifier << " for reason " << reason);
-        trigger->deferTestsForReason(identifier, reason);
+    if (const auto& trigger = m_page->wheelEventTestMonitor()) {
+        LOG_WITH_STREAM(WheelEventTestMonitor, stream << "    (!) AsyncScrollingCoordinator::deferForReason: Deferring " << identifier << " for reason " << reason);
+        trigger->deferForReason(identifier, reason);
     }
 }
 
-void AsyncScrollingCoordinator::removeTestDeferralForReason(WheelEventTestTrigger::ScrollableAreaIdentifier identifier, WheelEventTestTrigger::DeferTestTriggerReason reason) const
+void AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason(WheelEventTestMonitor::ScrollableAreaIdentifier identifier, WheelEventTestMonitor::DeferReason reason) const
 {
     ASSERT(isMainThread());
-    if (!m_page || !m_page->expectsWheelEventTriggers())
+    if (!m_page || !m_page->isMonitoringWheelEvents())
         return;
 
-    if (const auto& trigger = m_page->testTrigger()) {
-        LOG_WITH_STREAM(WheelEventTestTriggers, stream << "    (!) AsyncScrollingCoordinator::removeTestDeferralForReason: Deferring " << identifier << " for reason " << reason);
-        trigger->removeTestDeferralForReason(identifier, reason);
+    if (const auto& trigger = m_page->wheelEventTestMonitor()) {
+        LOG_WITH_STREAM(WheelEventTestMonitor, stream << "    (!) AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason: Deferring " << identifier << " for reason " << reason);
+        trigger->removeDeferralForReason(identifier, reason);
     }
 }
 #endif
index 2877123..9be69aa 100644 (file)
@@ -55,15 +55,15 @@ public:
 
 #if PLATFORM(COCOA)
     WEBCORE_EXPORT void setActiveScrollSnapIndices(ScrollingNodeID, unsigned horizontalIndex, unsigned verticalIndex);
-    void deferTestsForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) const;
-    void removeTestDeferralForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) const;
+    void deferWheelEventTestCompletionForReason(WheelEventTestMonitor::ScrollableAreaIdentifier, WheelEventTestMonitor::DeferReason) const;
+    void removeWheelEventTestCompletionDeferralForReason(WheelEventTestMonitor::ScrollableAreaIdentifier, WheelEventTestMonitor::DeferReason) const;
 #endif
 
 #if ENABLE(CSS_SCROLL_SNAP)
     WEBCORE_EXPORT void updateScrollSnapPropertiesWithFrameView(const FrameView&) override;
 #endif
 
-    WEBCORE_EXPORT void updateExpectsWheelEventTestTriggerWithFrameView(const FrameView&) override;
+    WEBCORE_EXPORT void updateIsMonitoringWheelEventsForFrameView(const FrameView&) override;
 
     void reportExposedUnfilledArea(MonotonicTime, unsigned unfilledArea);
     void reportSynchronousScrollingReasonsChanged(MonotonicTime, SynchronousScrollingReasons);
index 4a8cf8c..095a929 100644 (file)
@@ -187,7 +187,7 @@ public:
     String synchronousScrollingReasonsAsText() const;
 
     EventTrackingRegions absoluteEventTrackingRegions() const;
-    virtual void updateExpectsWheelEventTestTriggerWithFrameView(const FrameView&) { }
+    virtual void updateIsMonitoringWheelEventsForFrameView(const FrameView&) { }
 
 protected:
     explicit ScrollingCoordinator(Page*);
index 2d99ac5..717bfc2 100644 (file)
@@ -56,7 +56,7 @@ ScrollingStateScrollingNode::ScrollingStateScrollingNode(const ScrollingStateScr
 #endif
     , m_scrollableAreaParameters(stateNode.scrollableAreaParameters())
     , m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode.requestedScrollPositionRepresentsProgrammaticScroll())
-    , m_expectsWheelEventTestTrigger(stateNode.expectsWheelEventTestTrigger())
+    , m_isMonitoringWheelEvents(stateNode.isMonitoringWheelEvents())
 {
     if (hasChangedProperty(ScrollContainerLayer))
         setScrollContainerLayer(stateNode.scrollContainerLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
@@ -90,7 +90,7 @@ void ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach()
     setPropertyChangedBit(CurrentHorizontalSnapOffsetIndex);
     setPropertyChangedBit(CurrentVerticalSnapOffsetIndex);
 #endif
-    setPropertyChangedBit(ExpectsWheelEventTestTrigger);
+    setPropertyChangedBit(IsMonitoringWheelEvents);
     setPropertyChangedBit(ScrollContainerLayer);
     setPropertyChangedBit(ScrolledContentsLayer);
     setPropertyChangedBit(HorizontalScrollbarLayer);
@@ -226,13 +226,13 @@ void ScrollingStateScrollingNode::setRequestedScrollPosition(const FloatPoint& r
     setPropertyChanged(RequestedScrollPosition);
 }
 
-void ScrollingStateScrollingNode::setExpectsWheelEventTestTrigger(bool expectsTestTrigger)
+void ScrollingStateScrollingNode::setIsMonitoringWheelEvents(bool isMonitoringWheelEvents)
 {
-    if (expectsTestTrigger == m_expectsWheelEventTestTrigger)
+    if (isMonitoringWheelEvents == m_isMonitoringWheelEvents)
         return;
 
-    m_expectsWheelEventTestTrigger = expectsTestTrigger;
-    setPropertyChanged(ExpectsWheelEventTestTrigger);
+    m_isMonitoringWheelEvents = isMonitoringWheelEvents;
+    setPropertyChanged(IsMonitoringWheelEvents);
 }
 
 void ScrollingStateScrollingNode::setScrollContainerLayer(const LayerRepresentation& layerRepresentation)
@@ -336,8 +336,8 @@ void ScrollingStateScrollingNode::dumpProperties(TextStream& ts, ScrollingStateT
 
     ts.dumpProperty("scrollable area parameters", m_scrollableAreaParameters);
 
-    if (m_expectsWheelEventTestTrigger)
-        ts.dumpProperty("expects wheel event test trigger", m_expectsWheelEventTestTrigger);
+    if (m_isMonitoringWheelEvents)
+        ts.dumpProperty("expects wheel event test trigger", m_isMonitoringWheelEvents);
 
     if (behavior & ScrollingStateTreeAsTextBehaviorIncludeLayerIDs) {
         if (m_scrollContainerLayer.layerID())
index 3c2de1d..4967a6c 100644 (file)
@@ -59,7 +59,7 @@ public:
         CurrentHorizontalSnapOffsetIndex,
         CurrentVerticalSnapOffsetIndex,
 #endif
-        ExpectsWheelEventTestTrigger,
+        IsMonitoringWheelEvents,
         ScrollContainerLayer,
         ScrolledContentsLayer,
         HorizontalScrollbarLayer,
@@ -113,8 +113,8 @@ public:
     bool requestedScrollPositionRepresentsProgrammaticScroll() const { return m_requestedScrollPositionRepresentsProgrammaticScroll; }
     WEBCORE_EXPORT void setRequestedScrollPosition(const FloatPoint&, bool representsProgrammaticScroll);
 
-    bool expectsWheelEventTestTrigger() const { return m_expectsWheelEventTestTrigger; }
-    WEBCORE_EXPORT void setExpectsWheelEventTestTrigger(bool);
+    bool isMonitoringWheelEvents() const { return m_isMonitoringWheelEvents; }
+    WEBCORE_EXPORT void setIsMonitoringWheelEvents(bool);
 
     const LayerRepresentation& scrollContainerLayer() const { return m_scrollContainerLayer; }
     WEBCORE_EXPORT void setScrollContainerLayer(const LayerRepresentation&);
@@ -171,7 +171,7 @@ private:
     ScrollableAreaParameters m_scrollableAreaParameters;
 
     bool m_requestedScrollPositionRepresentsProgrammaticScroll { false };
-    bool m_expectsWheelEventTestTrigger { false };
+    bool m_isMonitoringWheelEvents { false };
 };
 
 } // namespace WebCore
index cea131f..a192a2a 100644 (file)
@@ -30,7 +30,7 @@
 #include "PlatformWheelEvent.h"
 #include "Region.h"
 #include "ScrollingCoordinator.h"
-#include "WheelEventTestTrigger.h"
+#include "WheelEventTestMonitor.h"
 #include <wtf/HashMap.h>
 #include <wtf/Lock.h>
 #include <wtf/ThreadSafeRefCounted.h>
@@ -106,8 +106,9 @@ public:
 #if PLATFORM(MAC)
     virtual void handleWheelEventPhase(PlatformWheelEventPhase) = 0;
     virtual void setActiveScrollSnapIndices(ScrollingNodeID, unsigned /*horizontalIndex*/, unsigned /*verticalIndex*/) { }
-    virtual void deferTestsForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) { }
-    virtual void removeTestDeferralForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) { }
+
+    virtual void deferWheelEventTestCompletionForReason(WheelEventTestMonitor::ScrollableAreaIdentifier, WheelEventTestMonitor::DeferReason) { }
+    virtual void removeWheelEventTestCompletionDeferralForReason(WheelEventTestMonitor::ScrollableAreaIdentifier, WheelEventTestMonitor::DeferReason) { }
 #endif
 
 #if PLATFORM(COCOA)
index d035dad..d647b92 100644 (file)
@@ -97,8 +97,8 @@ void ScrollingTreeScrollingNode::commitStateBeforeChildren(const ScrollingStateN
     if (state.hasChangedProperty(ScrollingStateScrollingNode::ScrollableAreaParams))
         m_scrollableAreaParameters = state.scrollableAreaParameters();
 
-    if (state.hasChangedProperty(ScrollingStateScrollingNode::ExpectsWheelEventTestTrigger))
-        m_expectsWheelEventTestTrigger = state.expectsWheelEventTestTrigger();
+    if (state.hasChangedProperty(ScrollingStateScrollingNode::IsMonitoringWheelEvents))
+        m_isMonitoringWheelEvents = state.isMonitoringWheelEvents();
 
     if (state.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer))
         m_scrollContainerLayer = state.scrollContainerLayer();
index 16f8b6e..ae86f33 100644 (file)
@@ -126,7 +126,7 @@ protected:
     bool hasEnabledHorizontalScrollbar() const { return m_scrollableAreaParameters.hasEnabledHorizontalScrollbar; }
     bool hasEnabledVerticalScrollbar() const { return m_scrollableAreaParameters.hasEnabledVerticalScrollbar; }
 
-    bool expectsWheelEventTestTrigger() const { return m_expectsWheelEventTestTrigger; }
+    bool isMonitoringWheelEvents() const { return m_isMonitoringWheelEvents; }
 
     LayoutPoint parentToLocalPoint(LayoutPoint) const override;
     LayoutPoint localToContentsPoint(LayoutPoint) const override;
@@ -148,7 +148,7 @@ private:
     unsigned m_currentVerticalSnapPointIndex { 0 };
 #endif
     ScrollableAreaParameters m_scrollableAreaParameters;
-    bool m_expectsWheelEventTestTrigger { false };
+    bool m_isMonitoringWheelEvents { false };
     bool m_isFirstCommit { true };
 
     LayerRepresentation m_scrollContainerLayer;
index 9fac3c4..19a681f 100644 (file)
@@ -191,23 +191,23 @@ void ThreadedScrollingTree::setActiveScrollSnapIndices(ScrollingNodeID nodeID, u
     });
 }
 
-void ThreadedScrollingTree::deferTestsForReason(WheelEventTestTrigger::ScrollableAreaIdentifier identifier, WheelEventTestTrigger::DeferTestTriggerReason reason)
+void ThreadedScrollingTree::deferWheelEventTestCompletionForReason(WheelEventTestMonitor::ScrollableAreaIdentifier identifier, WheelEventTestMonitor::DeferReason reason)
 {
     if (!m_scrollingCoordinator)
         return;
 
     RunLoop::main().dispatch([scrollingCoordinator = m_scrollingCoordinator, identifier, reason] {
-        scrollingCoordinator->deferTestsForReason(identifier, reason);
+        scrollingCoordinator->deferWheelEventTestCompletionForReason(identifier, reason);
     });
 }
 
-void ThreadedScrollingTree::removeTestDeferralForReason(WheelEventTestTrigger::ScrollableAreaIdentifier identifier, WheelEventTestTrigger::DeferTestTriggerReason reason)
+void ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason(WheelEventTestMonitor::ScrollableAreaIdentifier identifier, WheelEventTestMonitor::DeferReason reason)
 {
     if (!m_scrollingCoordinator)
         return;
     
     RunLoop::main().dispatch([scrollingCoordinator = m_scrollingCoordinator, identifier, reason] {
-        scrollingCoordinator->removeTestDeferralForReason(identifier, reason);
+        scrollingCoordinator->removeWheelEventTestCompletionDeferralForReason(identifier, reason);
     });
 }
 
index e32ac5a..d1db790 100644 (file)
@@ -65,8 +65,9 @@ protected:
 #if PLATFORM(MAC)
     void handleWheelEventPhase(PlatformWheelEventPhase) override;
     void setActiveScrollSnapIndices(ScrollingNodeID, unsigned horizontalIndex, unsigned verticalIndex) override;
-    void deferTestsForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) override;
-    void removeTestDeferralForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) override;
+
+    void deferWheelEventTestCompletionForReason(WheelEventTestMonitor::ScrollableAreaIdentifier, WheelEventTestMonitor::DeferReason) override;
+    void removeWheelEventTestCompletionDeferralForReason(WheelEventTestMonitor::ScrollableAreaIdentifier, WheelEventTestMonitor::DeferReason) override;
 #endif
 
 #if PLATFORM(COCOA)
index 97d462b..62813a6 100644 (file)
@@ -60,8 +60,8 @@ public:
     void updateFromStateNode(const ScrollingStateScrollingNode&);
     void updateScrollbarPainters();
 
-    void deferTestsForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) const override;
-    void removeTestDeferralForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) const override;
+    void deferWheelEventTestCompletionForReason(WheelEventTestMonitor::ScrollableAreaIdentifier, WheelEventTestMonitor::DeferReason) const override;
+    void removeWheelEventTestCompletionDeferralForReason(WheelEventTestMonitor::ScrollableAreaIdentifier, WheelEventTestMonitor::DeferReason) const override;
 
 private:
     bool isAlreadyPinnedInDirectionOfGesture(const PlatformWheelEvent&, ScrollEventAxis);
index 6fbdf31..702194f 100644 (file)
@@ -90,11 +90,11 @@ bool ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent(const PlatformWheel
     }
 
 #if ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)
-    if (scrollingNode().expectsWheelEventTestTrigger()) {
+    if (scrollingNode().isMonitoringWheelEvents()) {
         if (scrollingTree().shouldHandleWheelEventSynchronously(wheelEvent))
-            removeTestDeferralForReason(reinterpret_cast<WheelEventTestTrigger::ScrollableAreaIdentifier>(scrollingNode().scrollingNodeID()), WheelEventTestTrigger::ScrollingThreadSyncNeeded);
+            removeWheelEventTestCompletionDeferralForReason(reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(scrollingNode().scrollingNodeID()), WheelEventTestMonitor::ScrollingThreadSyncNeeded);
         else
-            deferTestsForReason(reinterpret_cast<WheelEventTestTrigger::ScrollableAreaIdentifier>(scrollingNode().scrollingNodeID()), WheelEventTestTrigger::ScrollingThreadSyncNeeded);
+            deferWheelEventTestCompletionForReason(reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(scrollingNode().scrollingNodeID()), WheelEventTestMonitor::ScrollingThreadSyncNeeded);
     }
 #endif
 
@@ -307,22 +307,22 @@ FloatSize ScrollingTreeScrollingNodeDelegateMac::viewportSize() const
 }
 #endif
 
-void ScrollingTreeScrollingNodeDelegateMac::deferTestsForReason(WheelEventTestTrigger::ScrollableAreaIdentifier identifier, WheelEventTestTrigger::DeferTestTriggerReason reason) const
+void ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason(WheelEventTestMonitor::ScrollableAreaIdentifier identifier, WheelEventTestMonitor::DeferReason reason) const
 {
-    if (!scrollingNode().expectsWheelEventTestTrigger())
+    if (!scrollingNode().isMonitoringWheelEvents())
         return;
 
-    LOG_WITH_STREAM(WheelEventTestTriggers, stream << isMainThread() << "  ScrollingTreeScrollingNodeDelegateMac::deferTestsForReason: STARTING deferral for " << identifier << " because of " << reason);
-    scrollingTree().deferTestsForReason(identifier, reason);
+    LOG_WITH_STREAM(WheelEventTestMonitor, stream << isMainThread() << "  ScrollingTreeScrollingNodeDelegateMac::deferForReason: STARTING deferral for " << identifier << " because of " << reason);
+    scrollingTree().deferWheelEventTestCompletionForReason(identifier, reason);
 }
     
-void ScrollingTreeScrollingNodeDelegateMac::removeTestDeferralForReason(WheelEventTestTrigger::ScrollableAreaIdentifier identifier, WheelEventTestTrigger::DeferTestTriggerReason reason) const
+void ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason(WheelEventTestMonitor::ScrollableAreaIdentifier identifier, WheelEventTestMonitor::DeferReason reason) const
 {
-    if (!scrollingNode().expectsWheelEventTestTrigger())
+    if (!scrollingNode().isMonitoringWheelEvents())
         return;
     
-    LOG_WITH_STREAM(WheelEventTestTriggers, stream << isMainThread() << "  ScrollingTreeScrollingNodeDelegateMac::deferTestsForReason: ENDING deferral for " << identifier << " because of " << reason);
-    scrollingTree().removeTestDeferralForReason(identifier, reason);
+    LOG_WITH_STREAM(WheelEventTestMonitor, stream << isMainThread() << "  ScrollingTreeScrollingNodeDelegateMac::deferForReason: ENDING deferral for " << identifier << " because of " << reason);
+    scrollingTree().removeWheelEventTestCompletionDeferralForReason(identifier, reason);
 }
 
 void ScrollingTreeScrollingNodeDelegateMac::updateScrollbarPainters()
index 1ef7256..9d39123 100644 (file)
@@ -109,7 +109,7 @@ namespace WebCore {
     M(WebGPU) \
     M(WebRTC) \
     M(WebRTCStats) \
-    M(WheelEventTestTriggers) \
+    M(WheelEventTestMonitor) \
 
 #undef DECLARE_LOG_CHANNEL
 #define DECLARE_LOG_CHANNEL(name) \
index f8edc88..a611868 100644 (file)
@@ -228,20 +228,20 @@ FloatSize ScrollAnimator::viewportSize() const
 #endif
 
 #if (ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)) && PLATFORM(MAC)
-void ScrollAnimator::deferTestsForReason(WheelEventTestTrigger::ScrollableAreaIdentifier identifier, WheelEventTestTrigger::DeferTestTriggerReason reason) const
+void ScrollAnimator::deferWheelEventTestCompletionForReason(WheelEventTestMonitor::ScrollableAreaIdentifier identifier, WheelEventTestMonitor::DeferReason reason) const
 {
-    if (!m_wheelEventTestTrigger)
+    if (!m_wheelEventTestMonitor)
         return;
 
-    m_wheelEventTestTrigger->deferTestsForReason(identifier, reason);
+    m_wheelEventTestMonitor->deferForReason(identifier, reason);
 }
 
-void ScrollAnimator::removeTestDeferralForReason(WheelEventTestTrigger::ScrollableAreaIdentifier identifier, WheelEventTestTrigger::DeferTestTriggerReason reason) const
+void ScrollAnimator::removeWheelEventTestCompletionDeferralForReason(WheelEventTestMonitor::ScrollableAreaIdentifier identifier, WheelEventTestMonitor::DeferReason reason) const
 {
-    if (!m_wheelEventTestTrigger)
+    if (!m_wheelEventTestMonitor)
         return;
     
-    m_wheelEventTestTrigger->removeTestDeferralForReason(identifier, reason);
+    m_wheelEventTestMonitor->removeDeferralForReason(identifier, reason);
 }
 #endif
 
index 6e2a884..a5c69c5 100644 (file)
@@ -34,7 +34,7 @@
 #include "FloatPoint.h"
 #include "PlatformWheelEvent.h"
 #include "ScrollTypes.h"
-#include "WheelEventTestTrigger.h"
+#include "WheelEventTestMonitor.h"
 #include <wtf/FastMalloc.h>
 #include <wtf/Forward.h>
 
@@ -48,7 +48,7 @@ class FloatPoint;
 class PlatformTouchEvent;
 class ScrollableArea;
 class Scrollbar;
-class WheelEventTestTrigger;
+class WheelEventTestMonitor;
 
 #if ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)
 class ScrollAnimator : private ScrollControllerClient {
@@ -121,10 +121,11 @@ public:
     virtual bool isRubberBandInProgress() const { return false; }
     virtual bool isScrollSnapInProgress() const { return false; }
 
-    void setWheelEventTestTrigger(RefPtr<WheelEventTestTrigger>&& testTrigger) { m_wheelEventTestTrigger = testTrigger; }
+    void setWheelEventTestMonitor(RefPtr<WheelEventTestMonitor>&& testMonitor) { m_wheelEventTestMonitor = testMonitor; }
+
 #if (ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)) && PLATFORM(MAC)
-    void deferTestsForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) const override;
-    void removeTestDeferralForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) const override;
+    void deferWheelEventTestCompletionForReason(WheelEventTestMonitor::ScrollableAreaIdentifier, WheelEventTestMonitor::DeferReason) const override;
+    void removeWheelEventTestCompletionDeferralForReason(WheelEventTestMonitor::ScrollableAreaIdentifier, WheelEventTestMonitor::DeferReason) const override;
 #endif
     
 #if ENABLE(CSS_SCROLL_SNAP)
@@ -145,7 +146,7 @@ protected:
     void updateActiveScrollSnapIndexForOffset();
 
     ScrollableArea& m_scrollableArea;
-    RefPtr<WheelEventTestTrigger> m_wheelEventTestTrigger;
+    RefPtr<WheelEventTestMonitor> m_wheelEventTestMonitor;
 #if ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)
     ScrollController m_scrollController;
 #endif
index fe35ffa..fd8fe4e 100644 (file)
@@ -31,7 +31,7 @@
 #include "FloatPoint.h"
 #include "FloatSize.h"
 #include "ScrollTypes.h"
-#include "WheelEventTestTrigger.h"
+#include "WheelEventTestMonitor.h"
 #include <wtf/Noncopyable.h>
 #include <wtf/RunLoop.h>
 
@@ -45,7 +45,7 @@ namespace WebCore {
 class LayoutSize;
 class PlatformWheelEvent;
 class ScrollableArea;
-class WheelEventTestTrigger;
+class WheelEventTestMonitor;
 
 class ScrollControllerClient {
 protected:
@@ -79,8 +79,8 @@ public:
     virtual void adjustScrollPositionToBoundsIfNecessary() = 0;
 #endif
 
-    virtual void deferTestsForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) const { /* Do nothing */ }
-    virtual void removeTestDeferralForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) const { /* Do nothing */ }
+    virtual void deferWheelEventTestCompletionForReason(WheelEventTestMonitor::ScrollableAreaIdentifier, WheelEventTestMonitor::DeferReason) const { /* Do nothing */ }
+    virtual void removeWheelEventTestCompletionDeferralForReason(WheelEventTestMonitor::ScrollableAreaIdentifier, WheelEventTestMonitor::DeferReason) const { /* Do nothing */ }
 
 #if ENABLE(CSS_SCROLL_SNAP)
     virtual FloatPoint scrollOffset() const = 0;
@@ -166,9 +166,10 @@ private:
 
     bool shouldOverrideInertialScrolling() const;
     void statelessSnapTransitionTimerFired();
-    void startDeferringTestsDueToScrollSnapping();
-    void stopDeferringTestsDueToScrollSnapping();
     void scheduleStatelessScrollSnap();
+
+    void startDeferringWheelEventTestCompletionDueToScrollSnapping();
+    void stopDeferringWheelEventTestCompletionDueToScrollSnapping();
 #endif
 #endif
 
index 8fe38ad..3560bab 100644 (file)
@@ -28,7 +28,7 @@
 
 #import "LayoutSize.h"
 #import "PlatformWheelEvent.h"
-#import "WheelEventTestTrigger.h"
+#import "WheelEventTestMonitor.h"
 #import <sys/sysctl.h>
 #import <sys/time.h>
 
@@ -390,7 +390,7 @@ void ScrollController::startSnapRubberbandTimer()
     m_client.startSnapRubberbandTimer();
     m_snapRubberbandTimer.startRepeating(1_s / 60.);
 
-    m_client.deferTestsForReason(reinterpret_cast<WheelEventTestTrigger::ScrollableAreaIdentifier>(this), WheelEventTestTrigger::RubberbandInProgress);
+    m_client.deferWheelEventTestCompletionForReason(reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(this), WheelEventTestMonitor::RubberbandInProgress);
 }
 
 void ScrollController::stopSnapRubberbandTimer()
@@ -399,7 +399,7 @@ void ScrollController::stopSnapRubberbandTimer()
     m_snapRubberbandTimer.stop();
     m_snapRubberbandTimerIsActive = false;
     
-    m_client.removeTestDeferralForReason(reinterpret_cast<WheelEventTestTrigger::ScrollableAreaIdentifier>(this), WheelEventTestTrigger::RubberbandInProgress);
+    m_client.removeWheelEventTestCompletionDeferralForReason(reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(this), WheelEventTestMonitor::RubberbandInProgress);
 }
 
 void ScrollController::snapRubberBand()
@@ -493,7 +493,7 @@ void ScrollController::scheduleStatelessScrollSnap()
 
     static const Seconds statelessScrollSnapDelay = 750_ms;
     m_statelessSnapTransitionTimer.startOneShot(statelessScrollSnapDelay);
-    startDeferringTestsDueToScrollSnapping();
+    startDeferringWheelEventTestCompletionDueToScrollSnapping();
 }
 
 void ScrollController::statelessSnapTransitionTimerFired()
@@ -505,14 +505,14 @@ void ScrollController::statelessSnapTransitionTimerFired()
     startScrollSnapTimer();
 }
 
-void ScrollController::startDeferringTestsDueToScrollSnapping()
+void ScrollController::startDeferringWheelEventTestCompletionDueToScrollSnapping()
 {
-    m_client.deferTestsForReason(reinterpret_cast<WheelEventTestTrigger::ScrollableAreaIdentifier>(this), WheelEventTestTrigger::ScrollSnapInProgress);
+    m_client.deferWheelEventTestCompletionForReason(reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(this), WheelEventTestMonitor::ScrollSnapInProgress);
 }
 
-void ScrollController::stopDeferringTestsDueToScrollSnapping()
+void ScrollController::stopDeferringWheelEventTestCompletionDueToScrollSnapping()
 {
-    m_client.removeTestDeferralForReason(reinterpret_cast<WheelEventTestTrigger::ScrollableAreaIdentifier>(this), WheelEventTestTrigger::ScrollSnapInProgress);
+    m_client.removeWheelEventTestCompletionDeferralForReason(reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(this), WheelEventTestMonitor::ScrollSnapInProgress);
 }
 
 bool ScrollController::processWheelEventForScrollSnap(const PlatformWheelEvent& wheelEvent)
@@ -562,7 +562,7 @@ void ScrollController::startScrollSnapTimer()
     if (m_scrollSnapTimer.isActive())
         return;
 
-    startDeferringTestsDueToScrollSnapping();
+    startDeferringWheelEventTestCompletionDueToScrollSnapping();
     m_client.startScrollSnapTimer();
     m_scrollSnapTimer.startRepeating(1_s / 60.);
 }
@@ -572,7 +572,7 @@ void ScrollController::stopScrollSnapTimer()
     if (!m_scrollSnapTimer.isActive())
         return;
 
-    stopDeferringTestsDueToScrollSnapping();
+    stopDeferringWheelEventTestCompletionDueToScrollSnapping();
     m_client.stopScrollSnapTimer();
     m_scrollSnapTimer.stop();
 }
index f178286..d1234f1 100644 (file)
@@ -982,8 +982,8 @@ void ScrollAnimatorMac::didBeginScrollGesture() const
     [m_scrollerImpPair beginScrollGesture];
 
 #if ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)
-    if (m_wheelEventTestTrigger)
-        m_wheelEventTestTrigger->deferTestsForReason(reinterpret_cast<WheelEventTestTrigger::ScrollableAreaIdentifier>(this), WheelEventTestTrigger::ContentScrollInProgress);
+    if (m_wheelEventTestMonitor)
+        m_wheelEventTestMonitor->deferForReason(reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(this), WheelEventTestMonitor::ContentScrollInProgress);
 #endif
 }
 
@@ -995,8 +995,8 @@ void ScrollAnimatorMac::didEndScrollGesture() const
     [m_scrollerImpPair endScrollGesture];
 
 #if ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)
-    if (m_wheelEventTestTrigger)
-        m_wheelEventTestTrigger->removeTestDeferralForReason(reinterpret_cast<WheelEventTestTrigger::ScrollableAreaIdentifier>(this), WheelEventTestTrigger::ContentScrollInProgress);
+    if (m_wheelEventTestMonitor)
+        m_wheelEventTestMonitor->removeDeferralForReason(reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(this), WheelEventTestMonitor::ContentScrollInProgress);
 #endif
 }
 
@@ -1455,8 +1455,8 @@ void ScrollAnimatorMac::sendContentAreaScrolledSoon(const FloatSize& delta)
     if (!m_sendContentAreaScrolledTimer.isActive())
         m_sendContentAreaScrolledTimer.startOneShot(0_s);
 
-    if (m_wheelEventTestTrigger)
-        m_wheelEventTestTrigger->deferTestsForReason(reinterpret_cast<WheelEventTestTrigger::ScrollableAreaIdentifier>(this), WheelEventTestTrigger::ContentScrollInProgress);
+    if (m_wheelEventTestMonitor)
+        m_wheelEventTestMonitor->deferForReason(reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(this), WheelEventTestMonitor::ContentScrollInProgress);
 }
 
 void ScrollAnimatorMac::sendContentAreaScrolled(const FloatSize& delta)
@@ -1469,8 +1469,8 @@ void ScrollAnimatorMac::sendContentAreaScrolledTimerFired()
     sendContentAreaScrolled(m_contentAreaScrolledTimerScrollDelta);
     m_contentAreaScrolledTimerScrollDelta = FloatSize();
 
-    if (m_wheelEventTestTrigger)
-        m_wheelEventTestTrigger->removeTestDeferralForReason(reinterpret_cast<WheelEventTestTrigger::ScrollableAreaIdentifier>(this), WheelEventTestTrigger::ContentScrollInProgress);
+    if (m_wheelEventTestMonitor)
+        m_wheelEventTestMonitor->removeDeferralForReason(reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(this), WheelEventTestMonitor::ContentScrollInProgress);
 }
 
 void ScrollAnimatorMac::setVisibleScrollerThumbRect(const IntRect& scrollerThumb)
index 9677dae..a5a453e 100644 (file)
@@ -567,19 +567,19 @@ int RenderBox::scrollTop() const
     return hasOverflowClip() && layer() ? layer()->scrollPosition().y() : 0;
 }
 
-static void setupWheelEventTestTrigger(RenderLayer& layer)
+static void setupWheelEventMonitor(RenderLayer& layer)
 {
     Page& page = layer.renderer().page();
-    if (!page.expectsWheelEventTriggers())
+    if (!page.isMonitoringWheelEvents())
         return;
-    layer.scrollAnimator().setWheelEventTestTrigger(page.testTrigger());
+    layer.scrollAnimator().setWheelEventTestMonitor(page.wheelEventTestMonitor());
 }
 
 void RenderBox::setScrollLeft(int newLeft, ScrollType scrollType, ScrollClamping clamping)
 {
     if (!hasOverflowClip() || !layer())
         return;
-    setupWheelEventTestTrigger(*layer());
+    setupWheelEventMonitor(*layer());
     layer()->scrollToXPosition(newLeft, scrollType, clamping);
 }
 
@@ -587,7 +587,7 @@ void RenderBox::setScrollTop(int newTop, ScrollType scrollType, ScrollClamping c
 {
     if (!hasOverflowClip() || !layer())
         return;
-    setupWheelEventTestTrigger(*layer());
+    setupWheelEventMonitor(*layer());
     layer()->scrollToYPosition(newTop, scrollType, clamping);
 }
 
index aa1a677..9c44912 100644 (file)
 #include "StyleResolver.h"
 #include "TransformationMatrix.h"
 #include "TranslateTransformOperation.h"
-#include "WheelEventTestTrigger.h"
+#include "WheelEventTestMonitor.h"
 #include <stdio.h>
 #include <wtf/MonotonicTime.h>
 #include <wtf/StdLibExtras.h>
@@ -3336,8 +3336,8 @@ Ref<Scrollbar> RenderLayer::createScrollbar(ScrollbarOrientation orientation)
     else {
         widget = Scrollbar::createNativeScrollbar(*this, orientation, RegularScrollbar);
         didAddScrollbar(widget.get(), orientation);
-        if (page().expectsWheelEventTriggers())
-            scrollAnimator().setWheelEventTestTrigger(page().testTrigger());
+        if (page().isMonitoringWheelEvents())
+            scrollAnimator().setWheelEventTestMonitor(page().wheelEventTestMonitor());
     }
     renderer().view().frameView().addChild(*widget);
     return widget.releaseNonNull();
index 6b3c121..df9b14b 100644 (file)
@@ -62,7 +62,7 @@
 #include "SpatialNavigation.h"
 #include "StyleResolver.h"
 #include "StyleTreeResolver.h"
-#include "WheelEventTestTrigger.h"
+#include "WheelEventTestMonitor.h"
 #include <math.h>
 #include <wtf/IsoMallocInlines.h>
 #include <wtf/StackStats.h>
@@ -753,12 +753,12 @@ int RenderListBox::scrollTop() const
     return m_indexOffset * itemHeight();
 }
 
-static void setupWheelEventTestTrigger(RenderListBox& renderer)
+static void setupWheelEventTestMonitor(RenderListBox& renderer)
 {
-    if (!renderer.page().expectsWheelEventTriggers())
+    if (!renderer.page().isMonitoringWheelEvents())
         return;
 
-    renderer.scrollAnimator().setWheelEventTestTrigger(renderer.page().testTrigger());
+    renderer.scrollAnimator().setWheelEventTestMonitor(renderer.page().wheelEventTestMonitor());
 }
 
 void RenderListBox::setScrollTop(int newTop, ScrollType, ScrollClamping)
@@ -767,7 +767,8 @@ void RenderListBox::setScrollTop(int newTop, ScrollType, ScrollClamping)
     int index = newTop / itemHeight();
     if (index < 0 || index >= numItems() || index == m_indexOffset)
         return;
-    setupWheelEventTestTrigger(*this);
+
+    setupWheelEventTestMonitor(*this);
     scrollToOffsetWithoutAnimation(VerticalScrollbar, index);
 }
 
@@ -916,8 +917,8 @@ Ref<Scrollbar> RenderListBox::createScrollbar()
     else {
         widget = Scrollbar::createNativeScrollbar(*this, VerticalScrollbar, theme().scrollbarControlSizeForPart(ListboxPart));
         didAddScrollbar(widget.get(), VerticalScrollbar);
-        if (page().expectsWheelEventTriggers())
-            scrollAnimator().setWheelEventTestTrigger(page().testTrigger());
+        if (page().isMonitoringWheelEvents())
+            scrollAnimator().setWheelEventTestMonitor(page().wheelEventTestMonitor());
     }
     view().frameView().addChild(*widget);
     return widget.releaseNonNull();
index d1d434e..9050113 100644 (file)
@@ -39,7 +39,7 @@
 #include "Page.h"
 #include "SWContextManager.h"
 #include "ServiceWorkerGlobalScope.h"
-#include "WheelEventTestTrigger.h"
+#include "WheelEventTestMonitor.h"
 #include <JavaScriptCore/APICast.h>
 #include <JavaScriptCore/CallFrame.h>
 #include <JavaScriptCore/IdentifierInlines.h>
@@ -85,30 +85,30 @@ void monitorWheelEvents(WebCore::Frame& frame)
     if (!page)
         return;
 
-    page->ensureTestTrigger();
+    page->ensureWheelEventTestMonitor();
 }
 
 void setTestCallbackAndStartNotificationTimer(WebCore::Frame& frame, JSContextRef context, JSObjectRef jsCallbackFunction)
 {
     Page* page = frame.page();
-    if (!page || !page->expectsWheelEventTriggers())
+    if (!page || !page->isMonitoringWheelEvents())
         return;
 
     JSValueProtect(context, jsCallbackFunction);
     
-    page->ensureTestTrigger().setTestCallbackAndStartNotificationTimer([=](void) {
+    page->ensureWheelEventTestMonitor().setTestCallbackAndStartNotificationTimer([=](void) {
         JSObjectCallAsFunction(context, jsCallbackFunction, nullptr, 0, nullptr, nullptr);
         JSValueUnprotect(context, jsCallbackFunction);
     });
 }
 
-void clearWheelEventTestTrigger(WebCore::Frame& frame)
+void clearWheelEventTestMonitor(WebCore::Frame& frame)
 {
     Page* page = frame.page();
     if (!page)
         return;
     
-    page->clearTrigger();
+    page->clearWheelEventTestMonitor();
 }
 
 void setLogChannelToAccumulate(const String& name)
index 4ab9546..a6f9601 100644 (file)
@@ -48,7 +48,7 @@ void injectInternalsObject(JSContextRef) TEST_SUPPORT_EXPORT;
 void resetInternalsObject(JSContextRef) TEST_SUPPORT_EXPORT;
 void monitorWheelEvents(WebCore::Frame&) TEST_SUPPORT_EXPORT;
 void setTestCallbackAndStartNotificationTimer(WebCore::Frame&, JSContextRef, JSObjectRef) TEST_SUPPORT_EXPORT;
-void clearWheelEventTestTrigger(WebCore::Frame&) TEST_SUPPORT_EXPORT;
+void clearWheelEventTestMonitor(WebCore::Frame&) TEST_SUPPORT_EXPORT;
 
 void setLogChannelToAccumulate(const WTF::String& name) TEST_SUPPORT_EXPORT;
 void initializeLogChannelsIfNecessary() TEST_SUPPORT_EXPORT;
index 1070230..fd557a6 100644 (file)
         (WebKit::WebChromeClient::setMockWebAuthenticationConfiguration):
         * WebProcess/WebCoreSupport/WebChromeClient.h:
 
+2019-10-09  Simon Fraser  <simon.fraser@apple.com>
+
+        Rename WheelEventTestTrigger and improve naming in related code
+        https://bugs.webkit.org/show_bug.cgi?id=202772
+
+        Reviewed by Tim Horton.
+
+        Change the "test trigger" terminology to "monitor wheel events"; after all, tests
+        call monitorWheelEvents() and callAfterScrollingCompletes(), and this is not triggering
+        a test.
+
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageClearWheelEventTestMonitor):
+        (WKPageClearWheelEventTestTrigger): Deleted.
+        * UIProcess/API/C/WKPage.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::clearWheelEventTestMonitor):
+        (WebKit::WebPageProxy::clearWheelEventTestTrigger): Deleted.
+        * UIProcess/WebPageProxy.h:
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageStartMonitoringScrollOperations):
+        (WKBundlePageRegisterScrollOperationCompletionCallback):
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::createScrollbar):
+        * WebProcess/WebPage/EventDispatcher.cpp:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::clearWheelEventTestMonitor):
+        (WebKit::WebPage::clearWheelEventTestTrigger): Deleted.
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+
 2019-10-09  Andy Estes  <aestes@apple.com>
 
         [Cocoa] IPC::decode should gracefully handle a nil allowed class
index 104552b..4141b6b 100644 (file)
@@ -2858,9 +2858,9 @@ WKMediaState WKPageGetMediaState(WKPageRef page)
     return state;
 }
 
-void WKPageClearWheelEventTestTrigger(WKPageRef pageRef)
+void WKPageClearWheelEventTestMonitor(WKPageRef pageRef)
 {
-    toImpl(pageRef)->clearWheelEventTestTrigger();
+    toImpl(pageRef)->clearWheelEventTestMonitor();
 }
 
 void WKPageCallAfterNextPresentationUpdate(WKPageRef pageRef, void* context, WKPagePostPresentationUpdateFunction callback)
index 6f09ec6..b7bdf59 100644 (file)
@@ -151,7 +151,7 @@ WK_EXPORT void WKPageRestoreFromSessionState(WKPageRef page, WKTypeRef sessionSt
 
 WK_EXPORT double WKPageGetBackingScaleFactor(WKPageRef page);
 WK_EXPORT void WKPageSetCustomBackingScaleFactor(WKPageRef page, double customScaleFactor);
-WK_EXPORT void WKPageClearWheelEventTestTrigger(WKPageRef page);
+WK_EXPORT void WKPageClearWheelEventTestMonitor(WKPageRef page);
 
 WK_EXPORT bool WKPageSupportsTextZoom(WKPageRef page);
 WK_EXPORT double WKPageGetTextZoomFactor(WKPageRef page);
index 6a8faf9..08e142c 100644 (file)
@@ -8586,12 +8586,12 @@ void WebPageProxy::didChangeBackgroundColor()
     pageClient().didChangeBackgroundColor();
 }
 
-void WebPageProxy::clearWheelEventTestTrigger()
+void WebPageProxy::clearWheelEventTestMonitor()
 {
     if (!hasRunningProcess())
         return;
     
-    m_process->send(Messages::WebPage::ClearWheelEventTestTrigger(), m_webPageID);
+    m_process->send(Messages::WebPage::clearWheelEventTestMonitor(), m_webPageID);
 }
 
 void WebPageProxy::callAfterNextPresentationUpdate(WTF::Function<void (CallbackBase::Error)>&& callback)
index b7a9af8..a004e90 100644 (file)
@@ -1413,7 +1413,7 @@ public:
     void didLayoutForCustomContentProvider();
 
     // For testing
-    void clearWheelEventTestTrigger();
+    void clearWheelEventTestMonitor();
     void callAfterNextPresentationUpdate(WTF::Function<void (CallbackBase::Error)>&&);
 
     void didReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>);
index d1f1de0..244e5b9 100644 (file)
@@ -65,7 +65,7 @@
 #include <WebCore/RenderLayerCompositor.h>
 #include <WebCore/ScriptExecutionContext.h>
 #include <WebCore/SecurityOriginData.h>
-#include <WebCore/WheelEventTestTrigger.h>
+#include <WebCore/WheelEventTestMonitor.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/URL.h>
 
@@ -644,7 +644,7 @@ void WKBundlePageStartMonitoringScrollOperations(WKBundlePageRef pageRef)
     if (!page)
         return;
 
-    page->ensureTestTrigger();
+    page->ensureWheelEventTestMonitor();
 }
 
 bool WKBundlePageRegisterScrollOperationCompletionCallback(WKBundlePageRef pageRef, WKBundlePageTestNotificationCallback callback, void* context)
@@ -654,10 +654,10 @@ bool WKBundlePageRegisterScrollOperationCompletionCallback(WKBundlePageRef pageR
     
     WebKit::WebPage* webPage = WebKit::toImpl(pageRef);
     WebCore::Page* page = webPage ? webPage->corePage() : nullptr;
-    if (!page || !page->expectsWheelEventTriggers())
+    if (!page || !page->isMonitoringWheelEvents())
         return false;
     
-    page->ensureTestTrigger().setTestCallbackAndStartNotificationTimer([=]() {
+    page->ensureWheelEventTestMonitor().setTestCallbackAndStartNotificationTimer([=]() {
         callback(context);
     });
     return true;
index f4cb96a..0d0a667 100644 (file)
@@ -81,7 +81,7 @@
 #import <WebCore/ScrollbarTheme.h>
 #import <WebCore/Settings.h>
 #import <WebCore/WebAccessibilityObjectWrapperMac.h>
-#import <WebCore/WheelEventTestTrigger.h>
+#import <WebCore/WheelEventTestMonitor.h>
 #import <pal/spi/cg/CoreGraphicsSPI.h>
 #import <pal/spi/mac/NSMenuSPI.h>
 #import <wtf/UUID.h>
@@ -724,8 +724,8 @@ Ref<Scrollbar> PDFPlugin::createScrollbar(ScrollbarOrientation orientation)
     didAddScrollbar(widget.ptr(), orientation);
     if (Frame* frame = webFrame()->coreFrame()) {
         if (Page* page = frame->page()) {
-            if (page->expectsWheelEventTriggers())
-                scrollAnimator().setWheelEventTestTrigger(page->testTrigger());
+            if (page->isMonitoringWheelEvents())
+                scrollAnimator().setWheelEventTestMonitor(page->wheelEventTestMonitor());
         }
     }
     pluginView()->frame()->view()->addChild(widget);
index 0a25405..6807ed5 100644 (file)
@@ -33,7 +33,7 @@
 #include "WebPageProxyMessages.h"
 #include "WebProcess.h"
 #include <WebCore/Page.h>
-#include <WebCore/WheelEventTestTrigger.h>
+#include <WebCore/WheelEventTestMonitor.h>
 #include <wtf/MainThread.h>
 #include <wtf/RunLoop.h>
 #include <wtf/SystemTracing.h>
index c35c202..b790c3c 100644 (file)
@@ -6298,12 +6298,12 @@ void WebPage::postSynchronousMessageForTesting(const String& messageName, API::O
         returnData = webProcess.transformHandlesToObjects(returnUserData.object());
 }
 
-void WebPage::clearWheelEventTestTrigger()
+void WebPage::clearWheelEventTestMonitor()
 {
     if (!m_page)
         return;
 
-    m_page->clearTrigger();
+    m_page->clearWheelEventTestMonitor();
 }
 
 void WebPage::setShouldScaleViewToFitDocument(bool shouldScaleViewToFitDocument)
index b1765c1..45efea7 100644 (file)
@@ -1568,7 +1568,7 @@ private:
     void setShouldPlayToPlaybackTarget(uint64_t, bool);
 #endif
 
-    void clearWheelEventTestTrigger();
+    void clearWheelEventTestMonitor();
 
     void setShouldScaleViewToFitDocument(bool);
 
index 3096e2e..1506489 100644 (file)
@@ -516,7 +516,7 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType
     DidLosePointerLock()
 #endif
 
-    ClearWheelEventTestTrigger()
+    clearWheelEventTestMonitor()
     SetShouldScaleViewToFitDocument(bool shouldScaleViewToFitDocument)
 
 #if ENABLE(VIDEO) && USE(GSTREAMER)
index bf275fe..15b313f 100644 (file)
@@ -1,17 +1,3 @@
-2019-10-09  Daniel Bates  <dabates@apple.com>
-
-        Add support for CompactPointerTuple<..., OptionSet<...>>
-        https://bugs.webkit.org/show_bug.cgi?id=201316
-
-        Reviewed by Yusuke Suzuki.
-
-        Add a test to ensure we encode and decode a compact pointer tuple correctly when an uint8_t and
-        a OptionSet<> as the byte value portion of the tuple.
-
-        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
-        * TestWebKitAPI/Tests/WTF/CompactPointerTuple.cpp: Added.
-        (TestWebKitAPI::TEST):
-
 2019-10-09  Russell Epstein  <repstein@apple.com>
 
         Unreviewed, rolling out r250930.
         * TestWebKitAPI/Tests/WTF/CompactPointerTuple.cpp: Added.
         (TestWebKitAPI::TEST):
 
+2019-10-09  Simon Fraser  <simon.fraser@apple.com>
+
+        Rename WheelEventTestTrigger and improve naming in related code
+        https://bugs.webkit.org/show_bug.cgi?id=202772
+
+        Reviewed by Tim Horton.
+
+        Change the "test trigger" terminology to "monitor wheel events"; after all, tests
+        call monitorWheelEvents() and callAfterScrollingCompletes(), and this is not triggering
+        a test.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetWebViewToConsistentStateBeforeTesting):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::resetStateToConsistentValues):
+
+2019-10-09  Daniel Bates  <dabates@apple.com>
+
+        Add support for CompactPointerTuple<..., OptionSet<...>>
+        https://bugs.webkit.org/show_bug.cgi?id=201316
+
+        Reviewed by Yusuke Suzuki.
+
+        Add a test to ensure we encode and decode a compact pointer tuple correctly when an uint8_t and
+        a OptionSet<> as the byte value portion of the tuple.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WTF/CompactPointerTuple.cpp: Added.
+        (TestWebKitAPI::TEST):
+
 2019-10-09  Jonathan Bedard  <jbedard@apple.com>
 
         results.webkit.org: Increase default limit for test results
index 35d2641..84d3bc7 100644 (file)
@@ -1912,7 +1912,7 @@ static void resetWebViewToConsistentStateBeforeTesting(const TestOptions& option
 
 #if !PLATFORM(IOS_FAMILY)
     if (WebCore::Frame* frame = [webView _mainCoreFrame])
-        WebCoreTestSupport::clearWheelEventTestTrigger(*frame);
+        WebCoreTestSupport::clearWheelEventTestMonitor(*frame);
 #endif
 
 #if !PLATFORM(IOS_FAMILY)
index 657b79b..c1d20d9 100644 (file)
@@ -1001,7 +1001,7 @@ bool TestController::resetStateToConsistentValues(const TestOptions& options, Re
     // Re-set to the default backing scale factor by setting the custom scale factor to 0.
     WKPageSetCustomBackingScaleFactor(m_mainWebView->page(), 0);
 
-    WKPageClearWheelEventTestTrigger(m_mainWebView->page());
+    WKPageClearWheelEventTestMonitor(m_mainWebView->page());
 
     WKPageSetMuted(m_mainWebView->page(), true);