Title: [257844] trunk
Revision
257844
Author
simon.fra...@apple.com
Date
2020-03-04 08:17:19 -0800 (Wed, 04 Mar 2020)

Log Message

(r256513) [ Mac ] fast/scrolling/programmatic-scroll-to-zero-zero.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=207948

Reviewed by Zalan Bujtas.

Source/WebCore:

It was possible for WheelEventTestMonitor to fire the callback before receiving any wheel events, if
no deferral reasons happened before the timer fires. Let's require at least one deferral.

There was no deferral for main-thread iframe wheel event handling, so add that so that tests that
slow-scroll iframes work.

Should de-flake fast/scrolling/programmatic-scroll-to-zero-zero.html and maybe other tests.

* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* page/WheelEventTestMonitor.cpp:
(WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
(WebCore::WheelEventTestMonitor::deferForReason):
(WebCore::WheelEventTestMonitor::triggerTestTimerFired):
(WebCore::operator<<):
* page/WheelEventTestMonitor.h:
(WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
(WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):

Tools:

EventSendingController needs to trigger layout so that the WebHTMLView is not 0x0,
so that it receives the wheel events.

* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):

LayoutTests:

Remove line for fast/scrolling/programmatic-scroll-to-zero-zero.html.
Skip two Windows tests that, for unknown reasons, no longer get any scrolling
triggers.

* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (257843 => 257844)


--- trunk/LayoutTests/ChangeLog	2020-03-04 16:15:18 UTC (rev 257843)
+++ trunk/LayoutTests/ChangeLog	2020-03-04 16:17:19 UTC (rev 257844)
@@ -1,3 +1,17 @@
+2020-03-04  Simon Fraser  <simon.fra...@apple.com>
+
+        (r256513) [ Mac ] fast/scrolling/programmatic-scroll-to-zero-zero.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=207948
+
+        Reviewed by Zalan Bujtas.
+
+        Remove line for fast/scrolling/programmatic-scroll-to-zero-zero.html.
+        Skip two Windows tests that, for unknown reasons, no longer get any scrolling
+        triggers.
+
+        * platform/mac-wk2/TestExpectations:
+        * platform/win/TestExpectations:
+
 2020-03-04  Jacob Uphoff  <jacob_uph...@apple.com>
 
         [ iOS ] webrtc/video-replace-track.html has been flaky failing on iOS

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (257843 => 257844)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2020-03-04 16:15:18 UTC (rev 257843)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2020-03-04 16:17:19 UTC (rev 257844)
@@ -1070,8 +1070,6 @@
 
 webkit.org/b/208062 http/wpt/fetch/disable-speculative-for-reload.html [ Pass Failure ]
 
-webkit.org/b/208160 fast/scrolling/overflow-scroll-past-max.html [ Pass Failure ]
-
 webkit.org/b/208222 [ Release ] imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.https.html [ Pass Failure ]
 
 webkit.org/b/208264 [ Release ] fast/harness/uiscriptcontroller/concurrent-ui-side-scripts.html [ Pass Failure ]

Modified: trunk/LayoutTests/platform/win/TestExpectations (257843 => 257844)


--- trunk/LayoutTests/platform/win/TestExpectations	2020-03-04 16:15:18 UTC (rev 257843)
+++ trunk/LayoutTests/platform/win/TestExpectations	2020-03-04 16:17:19 UTC (rev 257844)
@@ -277,6 +277,8 @@
 fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html [ Failure ]
 fast/events/wheelevent-in-vertical-scrollbar-in-rtl.html [ Failure ]
 scrollbars/scroll-rtl-or-bt-layer.html [ Timeout ]
+webkit.org/b/208559 fast/scrolling/arrow-key-scroll-in-rtl-document.html [ Skip ]
+webkit.org/b/208559 fast/scrolling/programmatic-scroll-to-zero-zero.html [ Skip ]
 
 # TODO Needs testRunner.enableAutoResizeMode()
 fast/autoresize/ [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (257843 => 257844)


--- trunk/Source/WebCore/ChangeLog	2020-03-04 16:15:18 UTC (rev 257843)
+++ trunk/Source/WebCore/ChangeLog	2020-03-04 16:17:19 UTC (rev 257844)
@@ -1,3 +1,29 @@
+2020-03-04  Simon Fraser  <simon.fra...@apple.com>
+
+        (r256513) [ Mac ] fast/scrolling/programmatic-scroll-to-zero-zero.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=207948
+
+        Reviewed by Zalan Bujtas.
+
+        It was possible for WheelEventTestMonitor to fire the callback before receiving any wheel events, if
+        no deferral reasons happened before the timer fires. Let's require at least one deferral.
+
+        There was no deferral for main-thread iframe wheel event handling, so add that so that tests that
+        slow-scroll iframes work.
+
+        Should de-flake fast/scrolling/programmatic-scroll-to-zero-zero.html and maybe other tests.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleWheelEvent):
+        * page/WheelEventTestMonitor.cpp:
+        (WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
+        (WebCore::WheelEventTestMonitor::deferForReason):
+        (WebCore::WheelEventTestMonitor::triggerTestTimerFired):
+        (WebCore::operator<<):
+        * page/WheelEventTestMonitor.h:
+        (WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
+        (WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
+
 2020-03-04  Zalan Bujtas  <za...@apple.com>
 
         [LFC][IFC] Display::Run::TextContent::expand(unsigned) is called with the value of -1.

Modified: trunk/Source/WebCore/page/EventHandler.cpp (257843 => 257844)


--- trunk/Source/WebCore/page/EventHandler.cpp	2020-03-04 16:15:18 UTC (rev 257843)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2020-03-04 16:17:19 UTC (rev 257844)
@@ -103,6 +103,7 @@
 #include "VisibleUnits.h"
 #include "WheelEvent.h"
 #include "WheelEventDeltaFilter.h"
+#include "WheelEventTestMonitor.h"
 #include "WindowsKeyboardCodes.h"
 #include <wtf/Assertions.h>
 #include <wtf/NeverDestroyed.h>
@@ -2829,6 +2830,10 @@
     }
 #endif
 
+#if PLATFORM(COCOA)
+    WheelEventTestMonitorCompletionDeferrer deferrer(m_frame.page()->wheelEventTestMonitor().get(), this, WheelEventTestMonitor::DeferReason::HandlingWheelEventOnMainThread);
+#endif
+
     m_isHandlingWheelEvent = true;
     setFrameWasScrolledByUser();
 

Modified: trunk/Source/WebCore/page/FrameView.cpp (257843 => 257844)


--- trunk/Source/WebCore/page/FrameView.cpp	2020-03-04 16:15:18 UTC (rev 257843)
+++ trunk/Source/WebCore/page/FrameView.cpp	2020-03-04 16:17:19 UTC (rev 257844)
@@ -2453,6 +2453,10 @@
 
 void FrameView::scrollOffsetChangedViaPlatformWidgetImpl(const ScrollOffset& oldOffset, const ScrollOffset& newOffset)
 {
+#if PLATFORM(COCOA)
+    WheelEventTestMonitorCompletionDeferrer deferrer(frame().page()->wheelEventTestMonitor().get(), this, WheelEventTestMonitor::DeferReason::ContentScrollInProgress);
+#endif
+
     updateLayerPositionsAfterScrolling();
     updateCompositingLayersAfterScrolling();
     repaintSlowRepaintObjects();

Modified: trunk/Source/WebCore/page/WheelEventTestMonitor.cpp (257843 => 257844)


--- trunk/Source/WebCore/page/WheelEventTestMonitor.cpp	2020-03-04 16:15:18 UTC (rev 257843)
+++ trunk/Source/WebCore/page/WheelEventTestMonitor.cpp	2020-03-04 16:17:19 UTC (rev 257844)
@@ -51,6 +51,7 @@
     m_deferCompletionReasons.clear();
     m_completionCallback = nullptr;
     m_testForCompletionTimer.stop();
+    m_everHadDeferral = false;
     LOG_WITH_STREAM(WheelEventTestMonitor, stream << "      (=) WheelEventTestMonitor::clearAllTestDeferrals: cleared all test state.");
 }
 
@@ -69,7 +70,9 @@
     m_deferCompletionReasons.ensure(identifier, [] {
         return OptionSet<DeferReason>();
     }).iterator->value.add(reason);
-    
+
+    m_everHadDeferral = true;
+
     LOG_WITH_STREAM(WheelEventTestMonitor, stream << "      (=) WheelEventTestMonitor::deferForReason: id=" << identifier << ", reason=" << reason);
 }
 
@@ -95,6 +98,11 @@
         return;
     }
 
+    if (!m_everHadDeferral) {
+        LOG_WITH_STREAM(WheelEventTestMonitor, stream << "  WheelEventTestMonitor::triggerTestTimerFired - have not yet seen any deferral reasons");
+        return;
+    }
+
     auto functionCallback = WTFMove(m_completionCallback);
     m_testForCompletionTimer.stop();
 
@@ -107,6 +115,7 @@
 {
     switch (reason) {
     case WheelEventTestMonitor::HandlingWheelEvent: ts << "handling wheel event"; break;
+    case WheelEventTestMonitor::HandlingWheelEventOnMainThread: ts << "handling wheel event on main thread"; break;
     case WheelEventTestMonitor::RubberbandInProgress: ts << "rubberbanding"; break;
     case WheelEventTestMonitor::ScrollSnapInProgress: ts << "scroll-snapping"; break;
     case WheelEventTestMonitor::ScrollingThreadSyncNeeded: ts << "scrolling thread sync needed"; break;

Modified: trunk/Source/WebCore/page/WheelEventTestMonitor.h (257843 => 257844)


--- trunk/Source/WebCore/page/WheelEventTestMonitor.h	2020-03-04 16:15:18 UTC (rev 257843)
+++ trunk/Source/WebCore/page/WheelEventTestMonitor.h	2020-03-04 16:17:19 UTC (rev 257844)
@@ -47,11 +47,12 @@
     WEBCORE_EXPORT void clearAllTestDeferrals();
     
     enum DeferReason {
-        HandlingWheelEvent          = 1 << 0,
-        RubberbandInProgress        = 1 << 1,
-        ScrollSnapInProgress        = 1 << 2,
-        ScrollingThreadSyncNeeded   = 1 << 3,
-        ContentScrollInProgress     = 1 << 4,
+        HandlingWheelEvent              = 1 << 0,
+        HandlingWheelEventOnMainThread  = 1 << 1,
+        RubberbandInProgress            = 1 << 2,
+        ScrollSnapInProgress            = 1 << 3,
+        ScrollingThreadSyncNeeded       = 1 << 4,
+        ContentScrollInProgress         = 1 << 5,
     };
     typedef const void* ScrollableAreaIdentifier;
 
@@ -67,8 +68,32 @@
     RunLoop::Timer<WheelEventTestMonitor> m_testForCompletionTimer;
 
     ScrollableAreaReasonMap m_deferCompletionReasons;
+    bool m_everHadDeferral { false };
 };
 
+class WheelEventTestMonitorCompletionDeferrer {
+public:
+    WheelEventTestMonitorCompletionDeferrer(WheelEventTestMonitor* monitor, WheelEventTestMonitor::ScrollableAreaIdentifier identifier, WheelEventTestMonitor::DeferReason reason)
+        : m_monitor(monitor)
+        , m_identifier(identifier)
+        , m_reason(reason)
+    {
+        if (m_monitor)
+            m_monitor->deferForReason(m_identifier, m_reason);
+    }
+    
+    ~WheelEventTestMonitorCompletionDeferrer()
+    {
+        if (m_monitor)
+            m_monitor->removeDeferralForReason(m_identifier, m_reason);
+    }
+
+private:
+    RefPtr<WheelEventTestMonitor> m_monitor;
+    WheelEventTestMonitor::ScrollableAreaIdentifier m_identifier;
+    WheelEventTestMonitor::DeferReason m_reason;
+};
+
 WTF::TextStream& operator<<(WTF::TextStream&, WheelEventTestMonitor::DeferReason);
 WTF::TextStream& operator<<(WTF::TextStream&, const WheelEventTestMonitor::ScrollableAreaReasonMap&);
 

Modified: trunk/Tools/ChangeLog (257843 => 257844)


--- trunk/Tools/ChangeLog	2020-03-04 16:15:18 UTC (rev 257843)
+++ trunk/Tools/ChangeLog	2020-03-04 16:17:19 UTC (rev 257844)
@@ -1,3 +1,18 @@
+2020-03-04  Simon Fraser  <simon.fra...@apple.com>
+
+        (r256513) [ Mac ] fast/scrolling/programmatic-scroll-to-zero-zero.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=207948
+
+        Reviewed by Zalan Bujtas.
+
+        EventSendingController needs to trigger layout so that the WebHTMLView is not 0x0,
+        so that it receives the wheel events.
+
+        * DumpRenderTree/mac/EventSendingController.mm:
+        (-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
+        * DumpRenderTree/win/EventSender.cpp:
+        (mouseScrollBy):
+
 2020-03-04  Andres Gonzalez  <andresg...@apple.com>
 
         REGRESSION (r257739): two fast/events/autoscroll test have started to fail

Modified: trunk/Tools/DumpRenderTree/mac/EventSendingController.mm (257843 => 257844)


--- trunk/Tools/DumpRenderTree/mac/EventSendingController.mm	2020-03-04 16:15:18 UTC (rev 257843)
+++ trunk/Tools/DumpRenderTree/mac/EventSendingController.mm	2020-03-04 16:17:19 UTC (rev 257844)
@@ -852,6 +852,8 @@
 - (void)mouseScrollByX:(int)x andY:(int)y withWheel:(NSString*)phaseName andMomentumPhases:(NSString*)momentumName
 {
 #if PLATFORM(MAC)
+    [[[mainFrame frameView] documentView] layout];
+
     uint32_t phase = 0;
     if ([phaseName isEqualToString: @"none"])
         phase = 0;

Modified: trunk/Tools/DumpRenderTree/win/EventSender.cpp (257843 => 257844)


--- trunk/Tools/DumpRenderTree/win/EventSender.cpp	2020-03-04 16:15:18 UTC (rev 257843)
+++ trunk/Tools/DumpRenderTree/win/EventSender.cpp	2020-03-04 16:17:19 UTC (rev 257844)
@@ -832,6 +832,10 @@
     RECT rect;
     ::GetWindowRect(webViewWindow, &rect);
 
+    COMPtr<IWebFramePrivate> framePrivate;
+    if (SUCCEEDED(frame->QueryInterface(&framePrivate)))
+        framePrivate->layout();
+
     if (x) {
         UINT scrollChars = 1;
         ::SystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0, &scrollChars, 0);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to