2019-10-10 00:24:44 +00:00
/*
* 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"
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
# include "Page.h"
2019-10-19 19:56:35 +00:00
# include <wtf/OptionSet.h>
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
# include <wtf/RunLoop.h>
2019-10-10 00:24:44 +00:00
# include <wtf/text/TextStream.h>
# if !LOG_DISABLED
# include <wtf/text/CString.h>
# include <wtf/text/StringBuilder.h>
# endif
namespace WebCore {
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
WheelEventTestMonitor : : WheelEventTestMonitor ( Page & page )
: m_page ( page )
2019-10-10 00:24:44 +00:00
{
}
void WheelEventTestMonitor : : clearAllTestDeferrals ( )
{
2021-05-20 18:41:33 +00:00
Locker locker { m_lock } ;
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
2019-10-16 01:04:41 +00:00
ASSERT ( isMainThread ( ) ) ;
2019-10-10 00:24:44 +00:00
m_deferCompletionReasons . clear ( ) ;
m_completionCallback = nullptr ;
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
m_everHadDeferral = false ;
m_receivedWheelEndOrCancel = false ;
m_receivedMomentumEnd = false ;
LOG_WITH_STREAM ( WheelEventTestMonitor , stream < < " WheelEventTestMonitor::clearAllTestDeferrals: cleared all test state. " ) ;
2019-10-10 00:24:44 +00:00
}
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
void WheelEventTestMonitor : : setTestCallbackAndStartMonitoring ( bool expectWheelEndOrCancel , bool expectMomentumEnd , WTF : : Function < void ( ) > & & functionCallback )
2019-10-10 00:24:44 +00:00
{
2021-05-20 18:41:33 +00:00
Locker locker { m_lock } ;
2019-10-16 01:04:41 +00:00
ASSERT ( isMainThread ( ) ) ;
m_completionCallback = WTFMove ( functionCallback ) ;
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
# if ENABLE(KINETIC_SCROLLING)
m_expectWheelEndOrCancel = expectWheelEndOrCancel ;
m_expectMomentumEnd = expectMomentumEnd ;
# else
UNUSED_PARAM ( expectWheelEndOrCancel ) ;
UNUSED_PARAM ( expectMomentumEnd ) ;
# endif
2020-10-06 21:33:42 +00:00
m_page . scheduleRenderingUpdate ( RenderingUpdateStep : : WheelEventMonitorCallbacks ) ;
2020-03-24 04:17:19 +00:00
LOG_WITH_STREAM ( WheelEventTestMonitor , stream < < " WheelEventTestMonitor::setTestCallbackAndStartMonitoring - expect end/cancel " < < expectWheelEndOrCancel < < " , expect momentum end " < < expectMomentumEnd ) ;
2019-10-10 00:24:44 +00:00
}
void WheelEventTestMonitor : : deferForReason ( ScrollableAreaIdentifier identifier , DeferReason reason )
{
2021-05-20 18:41:33 +00:00
Locker locker { m_lock } ;
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
2019-10-10 00:24:44 +00:00
m_deferCompletionReasons . ensure ( identifier , [ ] {
return OptionSet < DeferReason > ( ) ;
} ) . iterator - > value . add ( reason ) ;
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
m_everHadDeferral = true ;
2019-10-10 00:24:44 +00:00
LOG_WITH_STREAM ( WheelEventTestMonitor , stream < < " (=) WheelEventTestMonitor::deferForReason: id= " < < identifier < < " , reason= " < < reason ) ;
}
void WheelEventTestMonitor : : removeDeferralForReason ( ScrollableAreaIdentifier identifier , DeferReason reason )
{
2021-05-20 18:41:33 +00:00
Locker locker { m_lock } ;
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
2019-10-10 00:24:44 +00:00
auto it = m_deferCompletionReasons . find ( identifier ) ;
2020-12-02 03:25:42 +00:00
if ( it = = m_deferCompletionReasons . end ( ) ) {
LOG_WITH_STREAM ( WheelEventTestMonitor , stream < < " (=) WheelEventTestMonitor::removeDeferralForReason: failed to find defer for id= " < < identifier < < " , reason= " < < reason ) ;
2019-10-10 00:24:44 +00:00
return ;
2020-12-02 03:25:42 +00:00
}
2019-10-10 00:24:44 +00:00
LOG_WITH_STREAM ( WheelEventTestMonitor , stream < < " (=) WheelEventTestMonitor::removeDeferralForReason: id= " < < identifier < < " , reason= " < < reason ) ;
it - > value . remove ( reason ) ;
if ( it - > value . isEmpty ( ) )
m_deferCompletionReasons . remove ( it ) ;
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
scheduleCallbackCheck ( ) ;
2019-10-10 00:24:44 +00:00
}
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
void WheelEventTestMonitor : : receivedWheelEvent ( const PlatformWheelEvent & event )
2019-10-10 00:24:44 +00:00
{
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
# if ENABLE(KINETIC_SCROLLING)
2021-05-20 18:41:33 +00:00
Locker locker { m_lock } ;
2020-11-11 00:28:59 +00:00
if ( event . phase ( ) = = PlatformWheelEventPhase : : Ended | | event . phase ( ) = = PlatformWheelEventPhase : : Cancelled )
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
m_receivedWheelEndOrCancel = true ;
2020-11-11 00:28:59 +00:00
if ( event . momentumPhase ( ) = = PlatformWheelEventPhase : : Ended )
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
m_receivedMomentumEnd = true ;
# endif
}
void WheelEventTestMonitor : : scheduleCallbackCheck ( )
{
2021-03-12 04:48:22 +00:00
ensureOnMainThread ( [ weakPage = makeWeakPtr ( m_page ) ] {
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
if ( weakPage )
2020-10-06 21:33:42 +00:00
weakPage - > scheduleRenderingUpdate ( RenderingUpdateStep : : WheelEventMonitorCallbacks ) ;
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
} ) ;
}
void WheelEventTestMonitor : : checkShouldFireCallbacks ( )
{
ASSERT ( isMainThread ( ) ) ;
{
2021-05-20 18:41:33 +00:00
Locker locker { m_lock } ;
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
if ( ! m_deferCompletionReasons . isEmpty ( ) ) {
LOG_WITH_STREAM ( WheelEventTestMonitor , stream < < " WheelEventTestMonitor::checkShouldFireCallbacks - scrolling still active, reasons " < < m_deferCompletionReasons ) ;
return ;
}
if ( ! m_everHadDeferral ) {
LOG_WITH_STREAM ( WheelEventTestMonitor , stream < < " WheelEventTestMonitor::checkShouldFireCallbacks - have not yet seen any deferral reasons " ) ;
return ;
}
if ( m_expectWheelEndOrCancel & & ! m_receivedWheelEndOrCancel ) {
LOG_WITH_STREAM ( WheelEventTestMonitor , stream < < " WheelEventTestMonitor::checkShouldFireCallbacks - have not seen end of of wheel phase " ) ;
return ;
}
if ( m_expectMomentumEnd & & ! m_receivedMomentumEnd ) {
LOG_WITH_STREAM ( WheelEventTestMonitor , stream < < " WheelEventTestMonitor::checkShouldFireCallbacks - have not seen end of of momentum phase " ) ;
return ;
}
}
2019-10-10 00:24:44 +00:00
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
if ( auto functionCallback = WTFMove ( m_completionCallback ) ) {
LOG_WITH_STREAM ( WheelEventTestMonitor , stream < < " WheelEventTestMonitor::checkShouldFireCallbacks: scrolling is idle, FIRING TEST " ) ;
2019-10-10 00:24:44 +00:00
functionCallback ( ) ;
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
} else
LOG_WITH_STREAM ( WheelEventTestMonitor , stream < < " WheelEventTestMonitor::checkShouldFireCallbacks - no callback " ) ;
2019-10-10 00:24:44 +00:00
}
TextStream & operator < < ( TextStream & ts , WheelEventTestMonitor : : DeferReason reason )
{
switch ( reason ) {
2019-10-17 22:15:09 +00:00
case WheelEventTestMonitor : : HandlingWheelEvent : ts < < " handling wheel event " ; break ;
eventSender.monitorWheelEvents() is very fragile
https://bugs.webkit.org/show_bug.cgi?id=197819
<rdar://problem/51319456>
Reviewed by Tim Horton.
Source/WebCore:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* Modules/applepay/ApplePaySession.cpp: Unified sources!
* dom/WindowEventLoop.cpp: Unified sources!
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::wheelEventTestMonitor const):
(WebCore::Page::clearWheelEventTestMonitor):
(WebCore::Page::isMonitoringWheelEvents const):
(WebCore::Page::ensureWheelEventTestMonitor):
* page/Page.h:
(WebCore::Page::wheelEventTestMonitor const): Deleted.
(WebCore::Page::clearWheelEventTestMonitor): Deleted.
(WebCore::Page::isMonitoringWheelEvents const): Deleted.
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::removeDeferralForReason):
(WebCore::WheelEventTestMonitor::receivedWheelEvent):
(WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
(WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
(WebCore::operator<<):
(WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
(WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
(WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::setWheelEventTestMonitor):
(WebCore::ScrollingTree::receivedWheelEvent):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
(WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
(WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::setWheelEventTestMonitor):
(ScrollingTreeMac::receivedWheelEvent):
(ScrollingTreeMac::deferWheelEventTestCompletionForReason):
(ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
* testing/js/WebCoreTestSupport.h:
Source/WebKit:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageRegisterScrollOperationCompletionCallback):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
Tools:
Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
adding back changes from r257844 that were reverted in r258558.
First, have EventSendingController keep track of whether it's seen then "end" event
for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
now waits until it sees these, which prevents premature triggering which was a common cause of
failure before.
Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
for completion in a callout from the end of Page::updateRendering(), which makes it test
and fire at a more consistent time.
Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
also resulting in a premature trigger.
* DumpRenderTree/mac/EventSendingController.h:
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController monitorWheelEvents]):
(-[EventSendingController callAfterScrollingCompletes:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::monitorWheelEvents):
(WTR::EventSendingController::callAfterScrollingCompletes):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html: Need to call eventSender.monitorWheelEvents()
for each subtest.
Canonical link: https://commits.webkit.org/222192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-19 04:06:37 +00:00
case WheelEventTestMonitor : : HandlingWheelEventOnMainThread : ts < < " handling wheel event on main thread " ; break ;
Only the first wheel event in a gesture should be cancelable
https://bugs.webkit.org/show_bug.cgi?id=218764
<rdar://problem/71248946>
Reviewed by Tim Horton.
Source/WebCore:
Implement the WebKit2 version of r270312, where only the first wheel event in a gesture is
cancelable.
When scrolling over an element with handlers, we do event handling on the main thread,
so we can take the compute value of EventHandler's Optional<WheelScrollGestureState>
from the first event and send it back to the scrolling thread.
However, the scrolling thread needs to block until this first event comes back from
the main thread. To achieve this, EventDispatcher::wheelEvent() now dispaches
main thread scrolls from the scrolling thread (not the dispatcher thread), and
waits on m_waitingForBeganEventCondition with a 50ms timeout for that first event to
come back.
In the normal case, main thread handling dispatches the event back to the scrolling
thread for scrolling via handleWheelEventAfterMainThread(), and then calls
wheelEventWasProcessedByMainThread() to signal the condition. If for some reason
handleWheelEventAfterMainThread() doesn't get called (e.g. nothing was scrollable),
then wheelEventWasProcessedByMainThread() still gets called to signal.
If m_waitingForBeganEventCondition times out, then the scrolling thread falls back
to non-blocking behaviour (as if the first event was not canceled).
Finally, when we know the gesture will become non-blocking, we transition to running
the scroll from the scrolling thread, which requires that we set up latching, hence
the changes in ScrollingTreeLatchingController.
Tested by existing tests in fast/events/wheel.
* page/EventHandler.cpp:
(WebCore::EventHandler::wheelEventWasProcessedByMainThread):
(WebCore::EventHandler::handleWheelEventInScrollableArea):
* page/WheelEventTestMonitor.cpp:
(WebCore::operator<<):
* page/WheelEventTestMonitor.h:
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::processWheelEventForScrolling):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::determineWheelEventProcessing):
(WebCore::ScrollingTree::setGestureState):
(WebCore::ScrollingTree::gestureState):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::willSendEventToMainThread):
(WebCore::ScrollingTree::waitForEventToBeProcessedByMainThread):
* page/scrolling/ScrollingTreeLatchingController.cpp:
(WebCore::ScrollingTreeLatchingController::receivedWheelEvent):
(WebCore::ScrollingTreeLatchingController::nodeDidHandleEvent):
* page/scrolling/ScrollingTreeLatchingController.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread):
(WebCore::ThreadedScrollingTree::wheelEventWasProcessedByMainThread):
(WebCore::ThreadedScrollingTree::willSendEventToMainThread):
(WebCore::ThreadedScrollingTree::waitForEventToBeProcessedByMainThread):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::handleWheelEventForScrolling): Need to track deferral
for WheelEventTestMonitor.
(WebCore::ScrollingCoordinatorMac::wheelEventWasProcessedByMainThread): This is now synchronous
to the scrolling thread so no need for the deferrer.
(WebCore::nextDeferIdentifier): Deleted.
* page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
(WebCore::ScrollingCoordinatorNicosia::wheelEventWasProcessedByMainThread):
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::handleWheelEvent):
Source/WebKit:
In EventDispatcher::wheelEvent(), all wheel events now bounce through the scrolling
thread, even those destined for main thread scrolling. This allows the scrolling thread
to wait on a condition for the event to come back to the scrolling thread via
handleWheelEventAfterMainThread(), since we have to know whether content called
preventDefault() on the first event before sending subsequent events.
* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::wheelEvent):
LayoutTests:
* fast/scrolling/mac/rubberband-overflow-in-wheel-region-root-jiggle.html: Make more robust.
* platform/mac-wk2/fast/events/wheel/wheel-events-become-non-cancelable-expected.txt: Test now passes in WK2.
Canonical link: https://commits.webkit.org/232108@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-04 07:10:03 +00:00
case WheelEventTestMonitor : : PostMainThreadWheelEventHandling : ts < < " post-main thread event handling " ; break ;
2019-10-10 00:24:44 +00:00
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 ;
2020-03-21 05:54:52 +00:00
case WheelEventTestMonitor : : RequestedScrollPosition : ts < < " requested scroll position " ; break ;
2019-10-10 00:24:44 +00:00
}
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