WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
scrollend-userscroll-on-Mac-for-ews
scrollend-mac-for-ews-002.diff (text/plain), 83.69 KB, created by
cathiechen
on 2020-07-21 10:06:40 PDT
(
hide
)
Description:
scrollend-userscroll-on-Mac-for-ews
Filename:
MIME Type:
Creator:
cathiechen
Created:
2020-07-21 10:06:40 PDT
Size:
83.69 KB
patch
obsolete
>diff --git a/ChangeLog b/ChangeLog >index e60b28a62f..e56f242496 100644 >--- a/ChangeLog >+++ b/ChangeLog >@@ -1,3 +1,16 @@ >+2020-04-09 Cathie Chen <cathiechen@igalia.com> >+ >+ Add support for overscroll events parsing >+ https://bugs.webkit.org/show_bug.cgi?id=208802 >+ >+ Reviewed by Frédéric Wang. >+ >+ Based on Frédéric Wang's patch. >+ >+ Add ENABLE_OVERSCROLL_EVENTS which is off by default. >+ >+ * Source/cmake/WebKitFeatures.cmake: >+ > 2020-07-10 Xabier Rodriguez Calvar <calvaris@igalia.com> > > [GStreamer][EME][OpenCDM] Implement OpenCDM support >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 43cca3f275..4daa7e70a4 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,20 @@ >+2020-07-21 Cathie Chen <cathiechen@igalia.com> >+ >+ Add support for scrollend event of user scrolling on Mac >+ https://bugs.webkit.org/show_bug.cgi?id=208813 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add user scrolling test for scrollend event. >+ >+ * TestExpectations: >+ * fast/events/scrollend-event-for-rubberband-expected.txt: Added. >+ * fast/events/scrollend-event-for-rubberband.html: Added. >+ * fast/events/scrollend-event-for-stateless-wheel-scroll-expected.txt: Added. >+ * fast/events/scrollend-event-for-stateless-wheel-scroll.html: Added. >+ * fast/events/scrollend-event-for-wheel-scroll-with-state-expected.txt: Added. >+ * fast/events/scrollend-event-for-wheel-scroll-with-state.html: Added. >+ > 2020-07-10 Chris Dumez <cdumez@apple.com> > > Unreviewed, skip imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-operations.https.html in Debug. >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index 0c7f771c7a..efcdccf838 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -172,7 +172,15 @@ http/tests/in-app-browser-privacy/ [ Skip ] > fast/harness/uiscriptcontroller [ Skip ] > > # Only iOS has an implementation of UIScriptController::sendEventStream(). >-imported/w3c/web-platform-tests/dom/events/scrolling [ Skip ] >+imported/w3c/web-platform-tests/dom/events/scrolling/overscroll-event-fired-to-document.html [ Skip ] >+imported/w3c/web-platform-tests/dom/events/scrolling/overscroll-event-fired-to-element-with-overscroll-behavior.html [ Skip ] >+imported/w3c/web-platform-tests/dom/events/scrolling/overscroll-event-fired-to-scrolled-element.html [ Skip ] >+imported/w3c/web-platform-tests/dom/events/scrolling/overscroll-event-fired-to-window.html [ Skip ] >+imported/w3c/web-platform-tests/dom/events/scrolling/scrollend-event-fired-after-snap.html [ Skip ] >+imported/w3c/web-platform-tests/dom/events/scrolling/scrollend-event-fired-to-document.html [ Skip ] >+imported/w3c/web-platform-tests/dom/events/scrolling/scrollend-event-fired-to-element-with-overscroll-behavior.html [ Skip ] >+imported/w3c/web-platform-tests/dom/events/scrolling/scrollend-event-fired-to-scrolled-element.html [ Skip ] >+imported/w3c/web-platform-tests/dom/events/scrolling/scrollend-event-fired-to-window.html [ Skip ] > > # This test only makes sense on Mac > fast/attachment/attachment-subtitle-resize.html [ Skip ] >diff --git a/LayoutTests/fast/events/scrollend-event-for-rubberband-expected.txt b/LayoutTests/fast/events/scrollend-event-for-rubberband-expected.txt >new file mode 100644 >index 0000000000..288eb1cd57 >--- /dev/null >+++ b/LayoutTests/fast/events/scrollend-event-for-rubberband-expected.txt >@@ -0,0 +1,2 @@ >+PASS Test for rubber-band scrolling scrollend event. >+ >diff --git a/LayoutTests/fast/events/scrollend-event-for-rubberband.html b/LayoutTests/fast/events/scrollend-event-for-rubberband.html >new file mode 100644 >index 0000000000..eb5fc3b23e >--- /dev/null >+++ b/LayoutTests/fast/events/scrollend-event-for-rubberband.html >@@ -0,0 +1,77 @@ >+<!DOCTYPE html><!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] --> >+<html> >+<head> >+ <style> >+ #targetDiv { >+ width: 200px; >+ height: 200px; >+ overflow: scroll; >+ } >+ #innerDiv { >+ width: 400px; >+ height: 400px; >+ } >+ </style> >+</head> >+<body style="margin:0" onload="runTest()"> >+ <div id="targetDiv"> >+ <div id="innerDiv"> >+ </div> >+ </div> >+ <div id="log"></div> >+</body> >+<script> >+var target_div = document.getElementById('targetDiv'); >+ >+function finished(message) { >+ document.getElementById("log").innerText = message + "\n"; >+ if (window.testRunner) >+ testRunner.notifyDone(); >+} >+ >+function onScrollEnd(event) { >+ if (event.cancelable || !event.bubbles) { >+ finished("FAIL, for document scrollend event cancelable should be false and bubble shoule be true."); >+ return; >+ } >+ >+ var scrollend_position = window.scrollY; >+ if (scrollend_position != 0) >+ finished("FAIL, window did not scroll."); >+ >+ setTimeout(() => { >+ if (scrollend_position == window.scrollY) >+ finished("PASS Test for rubber-band scrolling scrollend event."); >+ else >+ finished("FAIL, window's scroll position shouldn't change after getting scrollend event."); >+ }, 300); >+} >+ >+function onUnexpectedScrollEnd() { >+ finished("FAIL, target_div got unexpected scrollend event"); >+} >+ >+function runTest() { >+ if (!window.eventSender || !window.testRunner) { >+ finished("FAIL, eventSender or testRunner are not supported."); >+ return; >+ } >+ >+ testRunner.dumpAsText(); >+ testRunner.waitUntilDone(); >+ >+ // Make sure that no scrollend event is sent to target_div. >+ target_div.addEventListener("scrollend", onUnexpectedScrollEnd); >+ window.addEventListener("scrollend", onScrollEnd); >+ >+ // Test wheel event with states scroll. >+ eventSender.mouseMoveTo(100, 100); >+ eventSender.monitorWheelEvents(); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 1, "began", "none"); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 5, "changed", "none"); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 5, "changed", "none"); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 1, "changed", "none"); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "ended", "none"); >+} >+</script> >+</html> >\ No newline at end of file >diff --git a/LayoutTests/fast/events/scrollend-event-for-stateless-wheel-scroll-expected.txt b/LayoutTests/fast/events/scrollend-event-for-stateless-wheel-scroll-expected.txt >new file mode 100644 >index 0000000000..7e5d1c3259 >--- /dev/null >+++ b/LayoutTests/fast/events/scrollend-event-for-stateless-wheel-scroll-expected.txt >@@ -0,0 +1,2 @@ >+PASS Test for stateless wheel scrolling scrollend event. >+ >diff --git a/LayoutTests/fast/events/scrollend-event-for-stateless-wheel-scroll.html b/LayoutTests/fast/events/scrollend-event-for-stateless-wheel-scroll.html >new file mode 100644 >index 0000000000..cb1c60c172 >--- /dev/null >+++ b/LayoutTests/fast/events/scrollend-event-for-stateless-wheel-scroll.html >@@ -0,0 +1,77 @@ >+<!DOCTYPE html><!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] --> >+<html> >+<head> >+ <style> >+ #targetDiv { >+ width: 200px; >+ height: 200px; >+ overflow: scroll; >+ } >+ >+ #innerDiv { >+ width: 400px; >+ height: 400px; >+ } >+ </style> >+</head> >+<body style="margin:0" onload=runTest()> >+ <div id="targetDiv"> >+ <div id="innerDiv"> >+ </div> >+ </div> >+ <div id="log"></div> >+</body> >+<script> >+var target_div = document.getElementById('targetDiv'); >+ >+function finished(message) { >+ document.getElementById("log").innerText = message + "\n"; >+ if (window.testRunner) >+ testRunner.notifyDone(); >+} >+ >+function onScrollEnd(event) { >+ if (event.cancelable || event.bubbles) { >+ finished("FAIL, cancelable and bubbles of an element scrollend event should be false."); >+ return; >+ } >+ >+ var scrollend_position = target_div.scrollTop; >+ if (scrollend_position <= 0) >+ finished("FAIL, target_div did not scroll."); >+ >+ setTimeout(() => { >+ if (scrollend_position == target_div.scrollTop) >+ finished("PASS Test for stateless wheel scrolling scrollend event."); >+ else >+ finished("FAIL, target_div's scroll position shouldn't change after getting scrollend event."); >+ }, 300); >+} >+ >+function onUnexpectedScrollEnd() { >+ finished("FAIL, window got unexpected scrollend event"); >+} >+ >+function runTest() { >+ if (!window.eventSender || !window.testRunner) { >+ finished("FAIL, eventSender or testRunner are not supported."); >+ return; >+ } >+ >+ testRunner.dumpAsText(); >+ testRunner.waitUntilDone(); >+ >+ // Make sure that no scrollend event is sent to window. >+ window.addEventListener("scrollend", onUnexpectedScrollEnd); >+ target_div.addEventListener("scrollend", onScrollEnd); >+ >+ // Test wheel event with stateless scroll. >+ eventSender.mouseMoveTo(20, 20); >+ eventSender.monitorWheelEvents(); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "none", "none"); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -20, "none", "none"); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -20, "none", "none"); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "none", "none"); >+} >+</script> >+</html> >\ No newline at end of file >diff --git a/LayoutTests/fast/events/scrollend-event-for-wheel-scroll-with-state-expected.txt b/LayoutTests/fast/events/scrollend-event-for-wheel-scroll-with-state-expected.txt >new file mode 100644 >index 0000000000..0efd7eba0e >--- /dev/null >+++ b/LayoutTests/fast/events/scrollend-event-for-wheel-scroll-with-state-expected.txt >@@ -0,0 +1,2 @@ >+PASS test for wheel scrolling scrollend event. >+ >diff --git a/LayoutTests/fast/events/scrollend-event-for-wheel-scroll-with-state.html b/LayoutTests/fast/events/scrollend-event-for-wheel-scroll-with-state.html >new file mode 100644 >index 0000000000..bf6338d945 >--- /dev/null >+++ b/LayoutTests/fast/events/scrollend-event-for-wheel-scroll-with-state.html >@@ -0,0 +1,83 @@ >+<!DOCTYPE html><!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] --> >+<html> >+<head> >+ <style> >+ #targetDiv { >+ width: 200px; >+ height: 200px; >+ overflow: scroll; >+ } >+ >+ #innerDiv { >+ width: 400px; >+ height: 400px; >+ } >+ </style> >+</head> >+<body style="margin:0" onload=runTest()> >+ <div id="targetDiv"> >+ <div id="innerDiv"> >+ </div> >+ </div> >+ <div id="log"></div> >+</body> >+<script> >+ var target_div = document.getElementById('targetDiv'); >+ >+ function finished(message) { >+ document.getElementById("log").innerText = message + "\n"; >+ if (window.testRunner) >+ testRunner.notifyDone(); >+ } >+ >+ function onScrollEnd(event) { >+ if (event.cancelable || event.bubbles) { >+ finished("FAIL, cancelable and bubbles of an element scrollend event should be false."); >+ return; >+ } >+ >+ var scrollend_position = target_div.scrollTop; >+ if (scrollend_position <= 0) { >+ finished("FAIL, target_div did not scroll."); >+ return; >+ } >+ >+ setTimeout(() => { >+ if (scrollend_position == target_div.scrollTop) >+ finished("PASS test for wheel scrolling scrollend event."); >+ else >+ finished("FAIL, target scroll position shouldn't change after getting scrollend event."); >+ }, 300); >+ } >+ >+ function onUnexpectedScrollEnd() { >+ finished("FAIL, window got unexpected scrollend event"); >+ } >+ >+ function runTest() { >+ if (!window.eventSender || !window.testRunner) { >+ finished("FAIL, eventSender or testRunner are not support."); >+ return; >+ } >+ >+ testRunner.dumpAsText(); >+ testRunner.waitUntilDone(); >+ >+ // Make sure that no scrollend event is sent to window. >+ window.addEventListener("scrollend", onUnexpectedScrollEnd); >+ target_div.addEventListener("scrollend", onScrollEnd); >+ >+ // Test wheel event with states scroll. >+ eventSender.mouseMoveTo(20, 20); >+ eventSender.monitorWheelEvents(); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "began", "none"); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -5, "changed", "none"); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -5, "changed", "none"); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "changed", "none"); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "ended", "none"); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -5, "none", "begin"); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -5, "none", "continue"); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "none", "end"); >+ } >+</script> >+</html> >\ No newline at end of file >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 3f4c661919..9642f1cc25 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,16 @@ >+2020-04-09 Cathie Chen <cathiechen@igalia.com> >+ >+ Add support for overscroll events parsing >+ https://bugs.webkit.org/show_bug.cgi?id=208802 >+ >+ Reviewed by Frédéric Wang. >+ >+ Based on Frédéric Wang's patch. >+ >+ Add ENABLE_OVERSCROLL_EVENTS. >+ >+ * Configurations/FeatureDefines.xcconfig: >+ > 2020-07-09 Brian Burg <bburg@apple.com> > > REGRESSION(r262302): ITMLKit debuggables in listings are missing a title, use UUID instead >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index b80c39a930..4b3b8ce78e 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,12 @@ >+2020-07-21 Cathie Chen <cathiechen@igalia.com> >+ >+ Add support for scrollend event of user scrolling on Mac >+ https://bugs.webkit.org/show_bug.cgi?id=208813 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/PlatformEnableCocoa.h: >+ > 2020-07-10 Xabier Rodriguez Calvar <calvaris@igalia.com> > > [GStreamer][EME][OpenCDM] Implement OpenCDM support >diff --git a/Source/WTF/wtf/PlatformEnableCocoa.h b/Source/WTF/wtf/PlatformEnableCocoa.h >index f86eb0a1b8..ca99c6c068 100644 >--- a/Source/WTF/wtf/PlatformEnableCocoa.h >+++ b/Source/WTF/wtf/PlatformEnableCocoa.h >@@ -365,6 +365,10 @@ > #define ENABLE_OVERFLOW_SCROLLING_TOUCH 1 > #endif > >+#if !defined(ENABLE_OVERSCROLL_EVENTS) >+#define ENABLE_OVERSCROLL_EVENTS 1 >+#endif >+ > #if !defined(ENABLE_PAYMENT_REQUEST) > #define ENABLE_PAYMENT_REQUEST 1 > #endif >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index fcac521069..61cdd93db8 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,134 @@ >+2020-07-21 Cathie Chen <cathiechen@igalia.com> >+ >+ Add support for scrollend event of user scrolling on Mac >+ https://bugs.webkit.org/show_bug.cgi?id=208813 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch supports scrollend events for the following user scrolls on Mac. >+ 1. Wheel event scroll: For wheel event with state, not only it generates user scrolling, but also it might >+ generate momentum scrolling, RubberBand, or trigger scrollSnap. In order to detect the end of all these scroll actions, >+ we start a repeating timer (m_detectScrollendTimer) when gets the UserScrollEnd status. And fire scrollend events >+ when all the scroll actions stop. For stateless wheel event which is generated by mouse, scrollend couldn't be detected >+ by wheel events state, so we start a one-shot timer (m_detectStatelessScrollendTimer). If no new stateless wheel scroll >+ generated in 750ms, fire scrollend event. >+ 2. Scrollbar scroll: For pressing scrollbar scrolling, it's triggered by m_scrollTimer. So fire scrollend event when >+ m_scrollTimer fires or stops. For dragging thumb scrolling, it's triggered by mouse move. So fire scrollend event when >+ mouse up. >+ 3. Keyboard scroll: The scroll action end is set to RenderLayer::scroll or ScrollView::scroll. >+ 4. Dragging scroll: The mouse dragging scroll is triggered by m_autoscrollTimer in AutoscrollController. So fire scrollend >+ event when m_autoscrollTimer ends, it will call RenderBox::stopAutoscroll. >+ >+ Some user scroll actions might not actually generate scrolling, for instance, pressing on the scrollbar thumb. And FrameView >+ scroll is asynchronous, so the scrollend events should be fired when scroll position actually changed not when scroll actions >+ stop. So current approach is that ScrollableArea restores the requested user scroll positions which indicate that it will scroll. >+ When the above scroll actions stop, notifyUserScrollActionEnd() is called and will set m_requestingUserScrollPosition true. >+ After that, ScrollableArea will checkUserScrollEndPosition when the scroll position actually changed. >+ >+ Tests: fast/events/scrollend-event-for-rubberband.html >+ fast/events/scrollend-event-for-stateless-wheel-scroll.html >+ fast/events/scrollend-event-for-wheel-scroll-with-state.html >+ >+ * dom/Document.cpp: >+ (WebCore::Document::commonTeardown): >+ (WebCore::Document::addPendingScrollEndEventTarget): Append the targets to m_pendingScrollEndEventTargetList. >+ (WebCore::Document::runScrollSteps): Dispatch scrollend event for each target. >+ * dom/Document.h: Add m_pendingScrollEndEventTargetList which keeps the scrollend event targets. >+ * page/DOMWindow.cpp: >+ (WebCore::DOMWindow::scrollTo const): >+ * page/FrameView.cpp: >+ (WebCore::FrameView::setRequestingUserScrollPosition): For FrameView scroll is asynchronous, we save m_requestingUserScrollPosition, >+ then checkUserScrollEndPosition when FrameView actually scrolls. >+ (WebCore::FrameView::addPendingScrollEndEventTarget): Add Document to m_pendingScrollendEventTargetList in Document. >+ (WebCore::FrameView::setRequestingUserScrollPosition): Stores the user scroll position, so that it can check it when user scrolling finishes. >+ (WebCore::FrameView::notifyUserScrollActionEnd): Notify the scroll action has ended, we can start to checkUserScrollEndPosition(). >+ (WebCore::FrameView::checkUserScrollEndPosition): Compare current scroll position and m_requestingUserScrollPosition, if they are same >+ which indicates that the scroll ends. Then addPendingScrollEndEventTarget(). >+ * page/FrameView.h: >+ * page/scrolling/AsyncScrollingCoordinator.cpp: >+ (WebCore::AsyncScrollingCoordinator::notifyScrollDidEnd): Notify the current scroll ends. >+ * page/scrolling/AsyncScrollingCoordinator.h: >+ * page/scrolling/ScrollingCoordinator.h: >+ (WebCore::ScrollingCoordinator::notifyScrollDidEnd): Ditto. >+ * page/scrolling/ScrollingTree.h: >+ (WebCore::ScrollingTree::notifyScrollDidEnd): Ditto. >+ * page/scrolling/ScrollingTreeScrollingNode.cpp: >+ (WebCore::ScrollingTreeScrollingNode::canHandleWheelEvent const): The stateless wheel event doesn't trigger rubber-band. >+ * page/scrolling/ThreadedScrollingTree.cpp: >+ (WebCore::ThreadedScrollingTree::notifyScrollDidEnd): Ditto. >+ * page/scrolling/ThreadedScrollingTree.h: >+ * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: >+ * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: >+ (WebCore::ScrollingTreeScrollingNodeDelegateMac::notifyScrollDidEnd): Ditto. >+ * platform/ScrollAnimationSmooth.cpp: >+ * platform/ScrollAnimator.cpp: >+ (WebCore::ScrollAnimator::didAddHorizontalScrollbar): >+ * platform/ScrollAnimator.h: >+ (WebCore::ScrollAnimator::ScrollAnimator::isScrollAnimationHelperInProgress): To indicate that ScrollAnimationHelper is in progress. >+ * platform/ScrollView.cpp: >+ (WebCore::ScrollView::scrollTo): checkUserScrollEndPosition() when m_scrollPosition actually changes. >+ (WebCore::ScrollView::setScrollPosition): setRequestingUserScrollPosition for user scrolls. >+ (WebCore::ScrollView::scroll): Keyboard scroll scrollend. >+ * platform/ScrollableArea.cpp: >+ (WebCore::ScrollableArea::setScrollOffsetFromAnimation): setRequestingUserScrollPosition for user scrolls. >+ * platform/ScrollableArea.h: >+ (WebCore::ScrollableArea::addPendingScrollEndEventTarget): Ditto. >+ (WebCore::ScrollableArea::setRequestingUserScrollPosition): Ditto. >+ (WebCore::ScrollableArea::notifyUserScrollActionEnd): Ditto. >+ (WebCore::ScrollableArea::checkUserScrollEndPosition): Ditto. >+ * platform/Scrollbar.cpp: >+ (WebCore::Scrollbar::autoscrollTimerFired): notifyUserScrollActionEnd if m_scrollTimer is not active. >+ (WebCore::Scrollbar::stopTimerIfNeeded): notifyUserScrollActionEnd when m_scrollTimer stopped >+ * platform/cocoa/ScrollController.h: >+ (WebCore::ScrollControllerClient::notifyScrollDidEnd): Ditto. >+ * platform/cocoa/ScrollController.mm: >+ (WebCore::ScrollController::handleWheelEvent): Start the timer at PlatformWheelEventPhaseEnded phrase, and stop it >+ at PlatformWheelEventPhaseBegan phrase. scheduleDetectStatelessScrollend if it's stateless scroll event. >+ (WebCore::ScrollController::scheduleDetectStatelessScrollend): Call startOneShot 750ms. >+ (WebCore::ScrollController::detectStatelessScrollendTimerFired): Call startDetectScrollendTimer. >+ (WebCore::ScrollController::startDetectScrollendTimer): Start the timer, repeating 1/60 s >+ (WebCore::ScrollController::stopDetectScrollendTimer): Stop the timer and notifyScrollDidEnd. >+ (WebCore::ScrollController::detectScrollendTimerFired): If RubberBand, momentumScroll and scrollSnap is not in progress, stop the timer. >+ * platform/mac/ScrollAnimatorMac.h: >+ * platform/mac/ScrollAnimatorMac.mm: >+ (WebCore::ScrollAnimatorMac::scroll): Save m_requestingScrollPosition for FrameView m_scrollAnimationHelper scroll. m_requestingScrollPosition >+ is used to detect if ScrollAnimationHelper ends. >+ (WebCore::ScrollAnimatorMac::isScrollAnimationHelperInProgress): If current scroll position equals to m_requestingScrollPosition, it means >+ ScrollAnimationHelper has ended. >+ (WebCore::ScrollAnimatorMac::notifyScrollDidEnd): Ditto. >+ * rendering/RenderBox.cpp: >+ (WebCore::RenderBox::stopAutoscroll): notifyUserScrollActionEnd for dragging scroll. >+ * rendering/RenderBox.h: >+ (WebCore::RenderBox::stopAutoscroll): Deleted. >+ * rendering/RenderLayer.cpp: >+ (WebCore::RenderLayer::setScrollPosition): >+ (WebCore::RenderLayer::scrollToOffset): setRequestingUserScrollPosition for user scrolls. >+ (WebCore::RenderLayer::scrollTo): checkUserScrollEndPosition when RenderLayer scroll position actually changes. >+ (WebCore::RenderLayer::scrollRectToVisible): The scrollType in FrameView::setScrollPosition is always programmatic, so we need to >+ setRequestingUserScrollPosition for user scrolls here. >+ (WebCore::RenderLayer::scroll): notifyUserScrollActionEnd for Keyboard scrol. >+ * rendering/RenderLayer.h: >+ >+2020-04-09 Cathie Chen <cathiechen@igalia.com> >+ >+ Add support for overscroll events parsing >+ https://bugs.webkit.org/show_bug.cgi?id=208802 >+ >+ Reviewed by Frédéric Wang. >+ >+ Based on Frédéric Wang's patch. >+ >+ Parse onoverscroll/scrollend attribute and overscroll/overscroll event name. >+ >+ * Configurations/FeatureDefines.xcconfig: >+ * bindings/js/WebCoreBuiltinNames.h: >+ * dom/EventNames.h: >+ * dom/GlobalEventHandlers.idl: >+ * html/HTMLAttributeNames.in: >+ * html/HTMLElement.cpp: >+ (WebCore::HTMLElement::createEventHandlerNameMap): >+ * page/Settings.yaml: >+ > 2020-07-10 Zalan Bujtas <zalan@apple.com> > > [LFC][Floats] Normal flow element that establishes a new block formatting context must not overlap the margin box of any floats >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index 84dcd5ec19..986047b105 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,16 @@ >+2020-04-09 Cathie Chen <cathiechen@igalia.com> >+ >+ Add support for overscroll events parsing >+ https://bugs.webkit.org/show_bug.cgi?id=208802 >+ >+ Reviewed by Frédéric Wang. >+ >+ Based on Frédéric Wang's patch. >+ >+ Add ENABLE_OVERSCROLL_EVENTS. >+ >+ * Configurations/FeatureDefines.xcconfig: >+ > 2020-07-09 Brady Eidson <beidson@apple.com> > > Multiplex the HID and GameController gamepad providers on Mac. >diff --git a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >index ac39667dcd..ab642c9d01 100644 >--- a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >+++ b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >@@ -320,6 +320,8 @@ namespace WebCore { > macro(matchingElementInFlatTree) \ > macro(mediaStreamTrackConstraints) \ > macro(openDatabase) \ >+ macro(onoverscroll) \ >+ macro(onscrollend) \ > macro(ontouchcancel) \ > macro(ontouchend) \ > macro(ontouchmove) \ >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 5b62e2d960..439f1d0626 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -807,6 +807,10 @@ void Document::commonTeardown() > if (m_timelinesController) > m_timelinesController->detachFromDocument(); > >+#if ENABLE(OVERSCROLL_EVENTS) >+ m_pendingScrollEndEventTargetList = nullptr; >+#endif >+ > m_timeline = nullptr; > } > >@@ -4109,6 +4113,26 @@ void Document::addPendingScrollEventTarget(ContainerNode& target) > targets.append(target); > } > >+#if ENABLE(OVERSCROLL_EVENTS) >+void Document::addPendingScrollEndEventTarget(ContainerNode& target) >+{ >+ if (!settings().overscrollEventsEnabled()) >+ return; >+ >+ if (!m_pendingScrollEndEventTargetList) >+ m_pendingScrollEndEventTargetList = makeUnique<PendingScrollEventTargetList>(); >+ >+ auto& targets = m_pendingScrollEndEventTargetList->targets; >+ if (targets.findMatching([&] (auto& entry) { return entry.ptr() == ⌖ }) != notFound) >+ return; >+ >+ if (targets.isEmpty()) >+ scheduleTimedRenderingUpdate(); >+ >+ targets.append(target); >+} >+#endif >+ > void Document::setNeedsVisualViewportScrollEvent() > { > if (!m_needsVisualViewportScrollEvent) >@@ -4134,6 +4158,18 @@ void Document::runScrollSteps() > if (auto* window = domWindow()) > window->visualViewport().dispatchEvent(Event::create(eventNames().scrollEvent, Event::CanBubble::No, Event::IsCancelable::No)); > } >+ >+#if ENABLE(OVERSCROLL_EVENTS) >+ // Deal with scrollend event. >+ if (m_pendingScrollEndEventTargetList && !m_pendingScrollEndEventTargetList->targets.isEmpty()) { >+ LOG_WITH_STREAM(Events, stream << "Document" << this << "sending scrollend events to pending scroll event targets"); >+ auto currentScrollEndTargets = WTFMove(m_pendingScrollEndEventTargetList->targets); >+ for (auto& target : currentScrollEndTargets) { >+ auto bubbles = target->isDocumentNode() ? Event::CanBubble::Yes : Event::CanBubble::No; >+ target->dispatchEvent(Event::create(eventNames().scrollendEvent, bubbles, Event::IsCancelable::No)); >+ } >+ } >+#endif > } > > void Document::addAudioProducer(MediaProducer& audioProducer) >diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h >index bb549700ee..caafb28da9 100644 >--- a/Source/WebCore/dom/Document.h >+++ b/Source/WebCore/dom/Document.h >@@ -1381,6 +1381,9 @@ public: > void runResizeSteps(); > > void addPendingScrollEventTarget(ContainerNode&); >+#if ENABLE(OVERSCROLL_EVENTS) >+ void addPendingScrollEndEventTarget(ContainerNode&); >+#endif > void setNeedsVisualViewportScrollEvent(); > void runScrollSteps(); > >@@ -2082,6 +2085,9 @@ private: > > struct PendingScrollEventTargetList; > std::unique_ptr<PendingScrollEventTargetList> m_pendingScrollEventTargetList; >+#if ENABLE(OVERSCROLL_EVENTS) >+ std::unique_ptr<PendingScrollEventTargetList> m_pendingScrollEndEventTargetList; >+#endif > > #if ENABLE(MEDIA_STREAM) > HashSet<HTMLMediaElement*> m_mediaStreamStateChangeElements; >diff --git a/Source/WebCore/dom/EventNames.h b/Source/WebCore/dom/EventNames.h >index 2835328f32..733c05f127 100644 >--- a/Source/WebCore/dom/EventNames.h >+++ b/Source/WebCore/dom/EventNames.h >@@ -191,6 +191,7 @@ namespace WebCore { > macro(orientationchange) \ > macro(overconstrained) \ > macro(overflowchanged) \ >+ macro(overscroll) \ > macro(pagehide) \ > macro(pageshow) \ > macro(paste) \ >@@ -227,6 +228,7 @@ namespace WebCore { > macro(result) \ > macro(resume) \ > macro(scroll) \ >+ macro(scrollend) \ > macro(search) \ > macro(securitypolicyviolation) \ > macro(seeked) \ >diff --git a/Source/WebCore/dom/GlobalEventHandlers.idl b/Source/WebCore/dom/GlobalEventHandlers.idl >index 770aa9c3a7..1f276534f7 100644 >--- a/Source/WebCore/dom/GlobalEventHandlers.idl >+++ b/Source/WebCore/dom/GlobalEventHandlers.idl >@@ -132,4 +132,8 @@ > [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcedown; > [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcewillbegin; > [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforceup; >+ >+ // Event handlers from Overscroll Events API (https://wicg.github.io/overscroll-scrollend-events/) >+ [NotEnumerable, Conditional=OVERSCROLL_EVENTS, EnabledBySetting=OverscrollEvents] attribute EventHandler onoverscroll; >+ [NotEnumerable, Conditional=OVERSCROLL_EVENTS, EnabledBySetting=OverscrollEvents] attribute EventHandler onscrollend; > }; >diff --git a/Source/WebCore/html/HTMLAttributeNames.in b/Source/WebCore/html/HTMLAttributeNames.in >index cb30490408..e88cd889d4 100644 >--- a/Source/WebCore/html/HTMLAttributeNames.in >+++ b/Source/WebCore/html/HTMLAttributeNames.in >@@ -268,6 +268,7 @@ onmousewheel > ononline > onoffline > onorientationchange >+onoverscroll > onpagehide > onpageshow > onpaste >@@ -288,6 +289,7 @@ onratechange > onreset > onresize > onscroll >+onscrollend > onsearch > onseeked > onseeking >diff --git a/Source/WebCore/html/HTMLElement.cpp b/Source/WebCore/html/HTMLElement.cpp >index 69916ee608..90285d105d 100644 >--- a/Source/WebCore/html/HTMLElement.cpp >+++ b/Source/WebCore/html/HTMLElement.cpp >@@ -290,6 +290,7 @@ HTMLElement::EventHandlerNameMap HTMLElement::createEventHandlerNameMap() > &onmouseoverAttr.get(), > &onmouseupAttr.get(), > &onmousewheelAttr.get(), >+ &onoverscrollAttr.get(), > &onpasteAttr.get(), > &onpauseAttr.get(), > &onplayAttr.get(), >@@ -307,6 +308,7 @@ HTMLElement::EventHandlerNameMap HTMLElement::createEventHandlerNameMap() > &onresetAttr.get(), > &onresizeAttr.get(), > &onscrollAttr.get(), >+ &onscrollendAttr.get(), > &onsearchAttr.get(), > &onseekedAttr.get(), > &onseekingAttr.get(), >diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp >index 18b38091fa..bbb737f7dd 100644 >--- a/Source/WebCore/page/DOMWindow.cpp >+++ b/Source/WebCore/page/DOMWindow.cpp >@@ -1694,7 +1694,10 @@ void DOMWindow::scrollTo(const ScrollToOptions& options, ScrollClamping clamping > > // This is an optimization for the common case of scrolling to (0, 0) when the scroller is already at the origin. > // If an animated scroll is in progress, this optimization is skipped to ensure that the animated scroll is really stopped. >- if (view->currentScrollBehaviorStatus() == ScrollBehaviorStatus::NotInAnimation && !scrollToOptions.left.value() && !scrollToOptions.top.value() && view->contentsScrollPosition() == IntPoint(0, 0)) >+ if (view->currentScrollBehaviorStatus() == ScrollBehaviorStatus::NotInAnimation >+ && !scrollToOptions.left.value() >+ && !scrollToOptions.top.value() >+ && view->contentsScrollPosition() == IntPoint(0, 0)) > return; > > document()->updateLayoutIgnorePendingStylesheets(); >diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp >index 5127b490f4..cdbc6fd007 100644 >--- a/Source/WebCore/page/FrameView.cpp >+++ b/Source/WebCore/page/FrameView.cpp >@@ -2286,10 +2286,12 @@ void FrameView::setScrollPosition(const ScrollPosition& scrollPosition, ScrollCl > Page* page = frame().page(); > if (page && page->isMonitoringWheelEvents()) > scrollAnimator().setWheelEventTestMonitor(page->wheelEventTestMonitor()); >+ >+ ScrollPosition newScrollPosition = (!delegatesScrolling() && clamping == ScrollClamping::Clamped) ? adjustScrollPositionWithinRange(scrollPosition) : scrollPosition; > if (animated == AnimatedScroll::Yes) >- scrollToOffsetWithAnimation(scrollOffsetFromPosition(scrollPosition), currentScrollType(), clamping); >+ scrollToOffsetWithAnimation(scrollOffsetFromPosition(newScrollPosition), currentScrollType(), clamping); > else >- ScrollView::setScrollPosition(scrollPosition, clamping); >+ ScrollView::setScrollPosition(newScrollPosition, clamping, animated); > > setCurrentScrollType(oldScrollType); > } >@@ -3731,6 +3733,52 @@ void FrameView::scrollToOffsetWithAnimation(const ScrollOffset& offset, ScrollTy > setCurrentScrollType(previousScrollType); > } > >+#if ENABLE(OVERSCROLL_EVENTS) >+void FrameView::addPendingScrollEndEventTarget() >+{ >+ if (Document* document = frame().document()) >+ document->addPendingScrollEndEventTarget(*document); >+} >+ >+void FrameView::setRequestingUserScrollPosition(const ScrollPosition& position) >+{ >+ if (!frame().settings().overscrollEventsEnabled()) >+ return; >+ >+ m_requestingUserScrollPosition = position; >+} >+ >+void FrameView::notifyUserScrollActionEnd() >+{ >+ if (!frame().settings().overscrollEventsEnabled()) >+ return; >+ >+ m_isUserScrollActionEnd = true; >+ checkUserScrollEndPosition(); >+} >+ >+void FrameView::checkUserScrollEndPosition() >+{ >+ if (!frame().settings().overscrollEventsEnabled()) >+ return; >+ >+ if (scrollAnimator().isScrollAnimationHelperInProgress()) >+ return; >+ >+ if (!m_requestingUserScrollPosition) { >+ m_isUserScrollActionEnd = false; >+ return; >+ } >+ >+ if (!m_isUserScrollActionEnd || m_requestingUserScrollPosition.value() != scrollPosition()) >+ return; >+ >+ addPendingScrollEndEventTarget(); >+ m_requestingUserScrollPosition = WTF::nullopt; >+ m_isUserScrollActionEnd = false; >+} >+#endif >+ > float FrameView::adjustScrollStepForFixedContent(float step, ScrollbarOrientation orientation, ScrollGranularity granularity) > { > if (granularity != ScrollByPage || orientation == HorizontalScrollbar) >diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h >index 9eb195dd86..488a506161 100644 >--- a/Source/WebCore/page/FrameView.h >+++ b/Source/WebCore/page/FrameView.h >@@ -670,6 +670,14 @@ public: > > String debugDescription() const final; > >+#if ENABLE(OVERSCROLL_EVENTS) >+ void addPendingScrollEndEventTarget() final; >+ >+ void setRequestingUserScrollPosition(const ScrollPosition&) final; >+ void notifyUserScrollActionEnd() final; >+ void checkUserScrollEndPosition() final; >+#endif >+ > private: > explicit FrameView(Frame&); > >@@ -912,6 +920,11 @@ private: > > Pagination m_pagination; > >+#if ENABLE(OVERSCROLL_EVENTS) >+ Optional<ScrollPosition> m_requestingUserScrollPosition; >+ bool m_isUserScrollActionEnd { false }; >+#endif >+ > enum class ViewportRendererType : uint8_t { None, Document, Body }; > ViewportRendererType m_viewportRendererType { ViewportRendererType::None }; > ScrollPinningBehavior m_scrollPinningBehavior { DoNotPin }; >diff --git a/Source/WebCore/page/Settings.yaml b/Source/WebCore/page/Settings.yaml >index 22c9f6ab23..8648ecfff3 100644 >--- a/Source/WebCore/page/Settings.yaml >+++ b/Source/WebCore/page/Settings.yaml >@@ -934,6 +934,10 @@ isLoggedInAPIEnabled: > enterKeyHintEnabled: > initial: false > >+overscrollEventsEnabled: >+ initial: false >+ conditional: OVERSCROLL_EVENTS >+ > legacyGetUserMediaEnabled: > initial: false > conditional: MEDIA_STREAM >diff --git a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >index 60fb6f7999..c2793d5211 100644 >--- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >+++ b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >@@ -946,6 +946,29 @@ void AsyncScrollingCoordinator::reportSynchronousScrollingReasonsChanged(Monoton > m_page->performanceLoggingClient()->logScrollingEvent(PerformanceLoggingClient::ScrollingEvent::SwitchedScrollingMode, timestamp, reasons.toRaw()); > } > >+#if ENABLE(OVERSCROLL_EVENTS) >+void AsyncScrollingCoordinator::notifyScrollDidEnd(ScrollingNodeID scrollingNodeID) >+{ >+ ASSERT(isMainThread()); >+ >+ if (!m_page) >+ return; >+ >+ auto* frameView = frameViewForScrollingNode(scrollingNodeID); >+ if (!frameView) >+ return; >+ >+ if (scrollingNodeID == frameView->scrollingNodeID()) { >+ frameView->addPendingScrollEndEventTarget(); >+ return; >+ } >+ >+ // Overflow-scroll area. >+ if (auto* scrollableArea = frameView->scrollableAreaForScrollingNodeID(scrollingNodeID)) >+ scrollableArea->addPendingScrollEndEventTarget(); >+} >+#endif >+ > } // namespace WebCore > > #endif // ENABLE(ASYNC_SCROLLING) >diff --git a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h >index ed96056b6b..fc680dbe1b 100644 >--- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h >+++ b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h >@@ -71,6 +71,10 @@ public: > void reportExposedUnfilledArea(MonotonicTime, unsigned unfilledArea); > void reportSynchronousScrollingReasonsChanged(MonotonicTime, OptionSet<SynchronousScrollingReason>); > >+#if ENABLE(OVERSCROLL_EVENTS) >+ WEBCORE_EXPORT void notifyScrollDidEnd(ScrollingNodeID) override; >+#endif >+ > protected: > WEBCORE_EXPORT AsyncScrollingCoordinator(Page*); > >diff --git a/Source/WebCore/page/scrolling/ScrollingCoordinator.h b/Source/WebCore/page/scrolling/ScrollingCoordinator.h >index 9636c0ebc5..a56e27d8c8 100644 >--- a/Source/WebCore/page/scrolling/ScrollingCoordinator.h >+++ b/Source/WebCore/page/scrolling/ScrollingCoordinator.h >@@ -121,6 +121,10 @@ public: > virtual void handleWheelEventPhase(ScrollingNodeID, PlatformWheelEventPhase) { } > #endif > >+#if ENABLE(OVERSCROLL_EVENTS) >+ virtual void notifyScrollDidEnd(ScrollingNodeID) { } >+#endif >+ > // Force all scroll layer position updates to happen on the main thread. > WEBCORE_EXPORT void setForceSynchronousScrollLayerPositionUpdates(bool); > >diff --git a/Source/WebCore/page/scrolling/ScrollingTree.h b/Source/WebCore/page/scrolling/ScrollingTree.h >index 3185d9bb88..839e0b2d1d 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTree.h >+++ b/Source/WebCore/page/scrolling/ScrollingTree.h >@@ -152,6 +152,10 @@ public: > void handleWheelEventPhase(ScrollingNodeID, PlatformWheelEventPhase) { } > #endif > >+#if ENABLE(OVERSCROLL_EVENTS) >+ virtual void notifyScrollDidEnd(ScrollingNodeID) { } >+#endif >+ > #if PLATFORM(COCOA) > WEBCORE_EXPORT virtual void currentSnapPointIndicesDidChange(ScrollingNodeID, unsigned horizontal, unsigned vertical) = 0; > #endif >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp >index c2b1a99725..ca01107447 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp >+++ b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp >@@ -144,7 +144,7 @@ bool ScrollingTreeScrollingNode::canHandleWheelEvent(const PlatformWheelEvent& w > return true; > > // We always rubber-band the latched node, or the root node. >- if (isLatchedNode() || isRootNode()) >+ if (isLatchedNode() || (isRootNode() && (wheelEvent.phase() != PlatformWheelEventPhaseNone || wheelEvent.momentumPhase() != PlatformWheelEventPhaseNone))) > return true; > > return eventCanScrollContents(wheelEvent); >diff --git a/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp b/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp >index c67c92e69e..5a6371bcbe 100644 >--- a/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp >+++ b/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp >@@ -327,6 +327,18 @@ void ThreadedScrollingTree::displayDidRefresh(PlatformDisplayID displayID) > #endif > } > >+#if ENABLE(OVERSCROLL_EVENTS) >+void ThreadedScrollingTree::notifyScrollDidEnd(ScrollingNodeID nodeID) >+{ >+ if (!m_scrollingCoordinator) >+ return; >+ >+ RunLoop::main().dispatch([scrollingCoordinator = m_scrollingCoordinator, nodeID] { >+ scrollingCoordinator->notifyScrollDidEnd(nodeID); >+ }); >+} >+#endif >+ > } // namespace WebCore > > #endif // ENABLE(ASYNC_SCROLLING) && ENABLE(SCROLLING_THREAD) >diff --git a/Source/WebCore/page/scrolling/ThreadedScrollingTree.h b/Source/WebCore/page/scrolling/ThreadedScrollingTree.h >index 32dd5bc7af..efeb503bde 100644 >--- a/Source/WebCore/page/scrolling/ThreadedScrollingTree.h >+++ b/Source/WebCore/page/scrolling/ThreadedScrollingTree.h >@@ -72,6 +72,10 @@ protected: > void currentSnapPointIndicesDidChange(ScrollingNodeID, unsigned horizontal, unsigned vertical) override; > #endif > >+#if ENABLE(OVERSCROLL_EVENTS) >+ void notifyScrollDidEnd(ScrollingNodeID) override; >+#endif >+ > void reportExposedUnfilledArea(MonotonicTime, unsigned unfilledArea) override; > void reportSynchronousScrollingReasonsChanged(MonotonicTime, OptionSet<SynchronousScrollingReason>) override; > >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h b/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h >index eae093b1ef..cba6e377c7 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h >+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h >@@ -82,6 +82,10 @@ private: > void didStopRubberbandSnapAnimation() final; > void adjustScrollPositionToBoundsIfNecessary() final; > >+#if ENABLE(OVERSCROLL_EVENTS) >+ void notifyScrollDidEnd() override; >+#endif >+ > #if ENABLE(CSS_SCROLL_SNAP) > FloatPoint scrollOffset() const override; > void immediateScrollOnAxis(ScrollEventAxis, float delta) override; >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm >index 18867f97e3..70670b0e02 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm >+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm >@@ -331,6 +331,13 @@ void ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecess > immediateScrollBy(constrainedPosition - scrollPosition); > } > >+#if ENABLE(OVERSCROLL_EVENTS) >+void ScrollingTreeScrollingNodeDelegateMac::notifyScrollDidEnd() >+{ >+ scrollingTree().notifyScrollDidEnd(scrollingNode().scrollingNodeID()); >+} >+#endif >+ > #if ENABLE(CSS_SCROLL_SNAP) > FloatPoint ScrollingTreeScrollingNodeDelegateMac::scrollOffset() const > { >diff --git a/Source/WebCore/platform/ScrollAnimationSmooth.cpp b/Source/WebCore/platform/ScrollAnimationSmooth.cpp >index 2ca578a30f..5efef962b3 100644 >--- a/Source/WebCore/platform/ScrollAnimationSmooth.cpp >+++ b/Source/WebCore/platform/ScrollAnimationSmooth.cpp >@@ -28,7 +28,10 @@ > #include "config.h" > #include "ScrollAnimationSmooth.h" > >+#include "ContainerNode.h" >+#include "Document.h" > #include "FloatPoint.h" >+#include "RenderLayer.h" > #include "ScrollableArea.h" > > namespace WebCore { >diff --git a/Source/WebCore/platform/ScrollAnimator.cpp b/Source/WebCore/platform/ScrollAnimator.cpp >index 1c080cba9a..403bfc0ad9 100644 >--- a/Source/WebCore/platform/ScrollAnimator.cpp >+++ b/Source/WebCore/platform/ScrollAnimator.cpp >@@ -307,5 +307,4 @@ void ScrollAnimator::didAddHorizontalScrollbar(Scrollbar*) > { > m_animationProgrammaticScroll->updateVisibleLengths(); > } >- > } // namespace WebCore >diff --git a/Source/WebCore/platform/ScrollAnimator.h b/Source/WebCore/platform/ScrollAnimator.h >index 1e4f492342..2b6edfa9a0 100644 >--- a/Source/WebCore/platform/ScrollAnimator.h >+++ b/Source/WebCore/platform/ScrollAnimator.h >@@ -37,6 +37,7 @@ > #include "WheelEventTestMonitor.h" > #include <wtf/FastMalloc.h> > #include <wtf/Forward.h> >+#include <wtf/WeakPtr.h> > > #if ENABLE(RUBBER_BANDING) || ENABLE(CSS_SCROLL_SNAP) > #include "ScrollController.h" >@@ -131,6 +132,10 @@ public: > virtual String horizontalScrollbarStateForTesting() const { return emptyString(); } > virtual String verticalScrollbarStateForTesting() const { return emptyString(); } > >+#if ENABLE(OVERSCROLL_EVENTS) >+ virtual bool isScrollAnimationHelperInProgress() { return false; } >+#endif >+ > void setWheelEventTestMonitor(RefPtr<WheelEventTestMonitor>&& testMonitor) { m_wheelEventTestMonitor = testMonitor; } > > #if (ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)) && PLATFORM(MAC) >diff --git a/Source/WebCore/platform/ScrollView.cpp b/Source/WebCore/platform/ScrollView.cpp >index 6494c9fe52..0e2229f3a9 100644 >--- a/Source/WebCore/platform/ScrollView.cpp >+++ b/Source/WebCore/platform/ScrollView.cpp >@@ -487,6 +487,10 @@ void ScrollView::scrollTo(const ScrollPosition& newPosition) > > m_scrollPosition = newPosition; > >+#if ENABLE(OVERSCROLL_EVENTS) >+ checkUserScrollEndPosition(); >+#endif >+ > if (scrollbarsSuppressed()) > return; > >@@ -514,7 +518,7 @@ void ScrollView::completeUpdatesAfterScrollTo(const IntSize& scrollDelta) > updateCompositingLayersAfterScrolling(); > } > >-void ScrollView::setScrollPosition(const ScrollPosition& scrollPosition, ScrollClamping clamping, AnimatedScroll/* animated*/) >+void ScrollView::setScrollPosition(const ScrollPosition& scrollPosition, ScrollClamping clamping, AnimatedScroll /* animated*/) > { > LOG_WITH_STREAM(Scrolling, stream << "ScrollView::setScrollPosition " << scrollPosition); > >@@ -537,14 +541,23 @@ void ScrollView::setScrollPosition(const ScrollPosition& scrollPosition, ScrollC > updateScrollbars(newScrollPosition); > > setScrollBehaviorStatus(ScrollBehaviorStatus::NotInAnimation); >+ >+#if ENABLE(OVERSCROLL_EVENTS) >+ if (currentScrollType() == ScrollType::User) >+ setRequestingUserScrollPosition(newScrollPosition); >+#endif > } > > bool ScrollView::scroll(ScrollDirection direction, ScrollGranularity granularity) > { >- if (platformWidget()) >- return platformScroll(direction, granularity); >- >- return ScrollableArea::scroll(direction, granularity); >+ bool scrolled = platformWidget() ? platformScroll(direction, granularity) : ScrollableArea::scroll(direction, granularity); >+ if (scrolled) { >+#if ENABLE(OVERSCROLL_EVENTS) >+ notifyUserScrollActionEnd(); >+#endif >+ return true; >+ } >+ return false; > } > > bool ScrollView::logicalScroll(ScrollLogicalDirection direction, ScrollGranularity granularity) >diff --git a/Source/WebCore/platform/ScrollableArea.cpp b/Source/WebCore/platform/ScrollableArea.cpp >index 5cd297cf86..fc192efb7e 100644 >--- a/Source/WebCore/platform/ScrollableArea.cpp >+++ b/Source/WebCore/platform/ScrollableArea.cpp >@@ -32,6 +32,7 @@ > #include "config.h" > #include "ScrollableArea.h" > >+#include "ContainerNode.h" > #include "FloatPoint.h" > #include "GraphicsContext.h" > #include "GraphicsLayer.h" >@@ -234,10 +235,14 @@ void ScrollableArea::setScrollOffsetFromInternals(const ScrollOffset& offset) > void ScrollableArea::setScrollOffsetFromAnimation(const ScrollOffset& offset) > { > ScrollPosition position = scrollPositionFromOffset(offset); >- if (requestScrollPositionUpdate(position, currentScrollType())) >- return; > >- scrollPositionChanged(position); >+ if (!requestScrollPositionUpdate(position, currentScrollType())) >+ scrollPositionChanged(position); >+ >+#if ENABLE(OVERSCROLL_EVENTS) >+ if (currentScrollType() == ScrollType::User) >+ setRequestingUserScrollPosition(position); >+#endif > } > > void ScrollableArea::willStartLiveResize() >diff --git a/Source/WebCore/platform/ScrollableArea.h b/Source/WebCore/platform/ScrollableArea.h >index 6aee9ac8ae..4ce6db5c63 100644 >--- a/Source/WebCore/platform/ScrollableArea.h >+++ b/Source/WebCore/platform/ScrollableArea.h >@@ -37,6 +37,7 @@ class TextStream; > > namespace WebCore { > >+class ContainerNode; > class FloatPoint; > class GraphicsContext; > class LayoutPoint; >@@ -358,6 +359,14 @@ public: > > virtual String debugDescription() const = 0; > >+#if ENABLE(OVERSCROLL_EVENTS) >+ virtual void addPendingScrollEndEventTarget() { } >+ >+ virtual void setRequestingUserScrollPosition(const ScrollPosition&) { } >+ virtual void notifyUserScrollActionEnd() { } >+ virtual void checkUserScrollEndPosition() { } >+#endif >+ > protected: > WEBCORE_EXPORT ScrollableArea(); > WEBCORE_EXPORT virtual ~ScrollableArea(); >diff --git a/Source/WebCore/platform/Scrollbar.cpp b/Source/WebCore/platform/Scrollbar.cpp >index a6b5807389..e0ca14c429 100644 >--- a/Source/WebCore/platform/Scrollbar.cpp >+++ b/Source/WebCore/platform/Scrollbar.cpp >@@ -157,6 +157,10 @@ void Scrollbar::paint(GraphicsContext& context, const IntRect& damageRect, Widge > void Scrollbar::autoscrollTimerFired() > { > autoscrollPressedPart(theme().autoscrollTimerDelay()); >+#if ENABLE(OVERSCROLL_EVENTS) >+ if (!m_scrollTimer.isActive()) >+ m_scrollableArea.notifyUserScrollActionEnd(); >+#endif > } > > static bool thumbUnderMouse(Scrollbar* scrollbar) >@@ -215,6 +219,10 @@ void Scrollbar::stopTimerIfNeeded() > { > if (m_scrollTimer.isActive()) > m_scrollTimer.stop(); >+ >+#if ENABLE(OVERSCROLL_EVENTS) >+ m_scrollableArea.notifyUserScrollActionEnd(); >+#endif > } > > ScrollDirection Scrollbar::pressedPartScrollDirection() >diff --git a/Source/WebCore/platform/cocoa/ScrollController.h b/Source/WebCore/platform/cocoa/ScrollController.h >index 52f29531c3..8f9d97c6c6 100644 >--- a/Source/WebCore/platform/cocoa/ScrollController.h >+++ b/Source/WebCore/platform/cocoa/ScrollController.h >@@ -91,6 +91,10 @@ public: > virtual void adjustScrollPositionToBoundsIfNecessary() = 0; > #endif > >+#if ENABLE(OVERSCROLL_EVENTS) >+ virtual void notifyScrollDidEnd() { } >+#endif >+ > virtual void deferWheelEventTestCompletionForReason(WheelEventTestMonitor::ScrollableAreaIdentifier, WheelEventTestMonitor::DeferReason) const { /* Do nothing */ } > virtual void removeWheelEventTestCompletionDeferralForReason(WheelEventTestMonitor::ScrollableAreaIdentifier, WheelEventTestMonitor::DeferReason) const { /* Do nothing */ } > >@@ -193,6 +197,13 @@ private: > #endif > #endif > >+#if ENABLE(OVERSCROLL_EVENTS) >+ void scheduleDetectStatelessScrollend(); >+ void detectStatelessScrollendTimerFired(); >+ void startDetectScrollendTimer(); >+ void stopDetectScrollendTimer(); >+ void detectScrollendTimerFired(); >+#endif > ScrollControllerClient& m_client; > > #if PLATFORM(MAC) >@@ -219,6 +230,12 @@ private: > #endif > #endif > >+#if ENABLE(OVERSCROLL_EVENTS) >+ // FIXME: scrollSnap and scrollend can share the same timer for stateless scroll. >+ std::unique_ptr<ScrollControllerTimer> m_detectStatelessScrollendTimer; >+ std::unique_ptr<ScrollControllerTimer> m_detectScrollendTimer; >+#endif >+ > #if PLATFORM(MAC) > bool m_inScrollGesture { false }; > bool m_momentumScrollInProgress { false }; >diff --git a/Source/WebCore/platform/cocoa/ScrollController.mm b/Source/WebCore/platform/cocoa/ScrollController.mm >index ffec44544b..1202d2aa7b 100644 >--- a/Source/WebCore/platform/cocoa/ScrollController.mm >+++ b/Source/WebCore/platform/cocoa/ScrollController.mm >@@ -148,12 +148,17 @@ bool ScrollController::handleWheelEvent(const PlatformWheelEvent& wheelEvent) > m_overflowScrollDelta = FloatSize(); > > stopSnapRubberbandTimer(); >- >+#if ENABLE(OVERSCROLL_EVENTS) >+ stopDetectScrollendTimer(); >+#endif > return true; > } > > if (wheelEvent.phase() == PlatformWheelEventPhaseEnded) { > snapRubberBand(); >+#if ENABLE(OVERSCROLL_EVENTS) >+ startDetectScrollendTimer(); >+#endif > return true; > } > >@@ -166,6 +171,11 @@ bool ScrollController::handleWheelEvent(const PlatformWheelEvent& wheelEvent) > return false; > } > >+#if ENABLE(OVERSCROLL_EVENTS) >+ if (wheelEvent.phase() == PlatformWheelEventPhaseNone && wheelEvent.momentumPhase() == PlatformWheelEventPhaseNone) >+ scheduleDetectStatelessScrollend(); >+#endif >+ > float deltaX = m_overflowScrollDelta.width(); > float deltaY = m_overflowScrollDelta.height(); > >@@ -851,6 +861,64 @@ void ScrollController::setActiveScrollSnapIndicesForOffset(int x, int y) > } > #endif > >+#if ENABLE(OVERSCROLL_EVENTS) >+void ScrollController::scheduleDetectStatelessScrollend() >+{ >+ if (m_detectStatelessScrollendTimer) { >+ m_detectStatelessScrollendTimer->stop(); >+ m_detectStatelessScrollendTimer = nullptr; >+ } >+ static const Seconds statelessScrollEndDelay = 750_ms; >+ m_detectStatelessScrollendTimer = m_client.createTimer([this] { >+ detectStatelessScrollendTimerFired(); >+ }); >+ m_detectStatelessScrollendTimer->startOneShot(statelessScrollEndDelay); >+} >+ >+void ScrollController::detectStatelessScrollendTimerFired() >+{ >+ m_detectStatelessScrollendTimer = nullptr; >+ m_client.notifyScrollDidEnd(); >+} >+ >+void ScrollController::startDetectScrollendTimer() >+{ >+ if (m_detectScrollendTimer) >+ return; >+ m_detectScrollendTimer = m_client.createTimer([this] { >+ detectScrollendTimerFired(); >+ }); >+ m_detectScrollendTimer->startRepeating(1_s / 60.); >+} >+ >+void ScrollController::stopDetectScrollendTimer() >+{ >+ if (!m_detectScrollendTimer) >+ return; >+ >+ m_client.notifyScrollDidEnd(); >+ m_detectScrollendTimer->stop(); >+ m_detectScrollendTimer = nullptr; >+} >+ >+void ScrollController::detectScrollendTimerFired() >+{ >+ if (isRubberBandInProgress()) >+ return; >+ >+#if PLATFORM(MAC) >+ if (m_momentumScrollInProgress) >+ return; >+#if ENABLE(CSS_SCROLL_SNAP) >+ if (m_scrollSnapTimer) >+ return; >+#endif >+#endif >+ >+ stopDetectScrollendTimer(); >+} >+#endif >+ > } // namespace WebCore > > #endif // ENABLE(RUBBER_BANDING) >diff --git a/Source/WebCore/platform/mac/ScrollAnimatorMac.h b/Source/WebCore/platform/mac/ScrollAnimatorMac.h >index 62b2bd2999..d95d88950b 100644 >--- a/Source/WebCore/platform/mac/ScrollAnimatorMac.h >+++ b/Source/WebCore/platform/mac/ScrollAnimatorMac.h >@@ -141,6 +141,10 @@ private: > String horizontalScrollbarStateForTesting() const final; > String verticalScrollbarStateForTesting() const final; > >+#if ENABLE(OVERSCROLL_EVENTS) >+ bool isScrollAnimationHelperInProgress() override; >+#endif >+ > // ScrollControllerClient. > #if ENABLE(RUBBER_BANDING) > IntSize stretchAmount() const final; >@@ -157,9 +161,16 @@ private: > bool isAlreadyPinnedInDirectionOfGesture(const PlatformWheelEvent&, ScrollEventAxis) const; > #endif > >+#if ENABLE(OVERSCROLL_EVENTS) && (ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)) >+ void notifyScrollDidEnd() override; >+#endif >+ > bool m_haveScrolledSincePageLoad; > bool m_needsScrollerStyleUpdate; > IntRect m_visibleScrollerThumbRect; >+#if ENABLE(OVERSCROLL_EVENTS) >+ Optional<FloatPoint> m_requestingScrollPosition; >+#endif > }; > > } // namespace WebCore >diff --git a/Source/WebCore/platform/mac/ScrollAnimatorMac.mm b/Source/WebCore/platform/mac/ScrollAnimatorMac.mm >index 5f65303cea..f31b926468 100644 >--- a/Source/WebCore/platform/mac/ScrollAnimatorMac.mm >+++ b/Source/WebCore/platform/mac/ScrollAnimatorMac.mm >@@ -783,11 +783,12 @@ bool ScrollAnimatorMac::scroll(ScrollbarOrientation orientation, ScrollGranulari > { > m_haveScrolledSincePageLoad = true; > >- if (!scrollAnimationEnabledForSystem() || !m_scrollableArea.scrollAnimatorEnabled()) >- return ScrollAnimator::scroll(orientation, granularity, step, multiplier); >- >- if (granularity == ScrollByPixel) >+ if (!scrollAnimationEnabledForSystem() || !m_scrollableArea.scrollAnimatorEnabled() || granularity == ScrollByPixel) { >+#if ENABLE(OVERSCROLL_EVENTS) >+ m_requestingScrollPosition = WTF::nullopt; >+#endif > return ScrollAnimator::scroll(orientation, granularity, step, multiplier); >+ } > > FloatPoint currentPosition = this->currentPosition(); > FloatSize delta; >@@ -810,6 +811,9 @@ bool ScrollAnimatorMac::scroll(ScrollbarOrientation orientation, ScrollGranulari > > LOG_WITH_STREAM(Scrolling, stream << "ScrollAnimatorMac::scroll " << " from " << currentPosition << " to " << newPosition); > [m_scrollAnimationHelper scrollToPoint:newPosition]; >+#if ENABLE(OVERSCROLL_EVENTS) >+ m_requestingScrollPosition = newPosition; >+#endif > return true; > } > >@@ -921,6 +925,17 @@ void ScrollAnimatorMac::immediateScrollToPositionForScrollAnimation(const FloatP > immediateScrollToPosition(newPosition); > } > >+#if ENABLE(OVERSCROLL_EVENTS) >+bool ScrollAnimatorMac::isScrollAnimationHelperInProgress() >+{ >+ if (m_requestingScrollPosition && scrollableArea().scrollPosition() != roundedIntPoint(m_requestingScrollPosition.value())) >+ return true; >+ >+ m_requestingScrollPosition = WTF::nullopt; >+ return false; >+} >+#endif >+ > void ScrollAnimatorMac::notifyPositionChanged(const FloatSize& delta) > { > notifyContentAreaScrolled(delta); >@@ -1447,6 +1462,13 @@ void ScrollAnimatorMac::immediateScrollBy(const FloatSize& delta) > } > #endif > >+#if ENABLE(OVERSCROLL_EVENTS) && (ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)) >+void ScrollAnimatorMac::notifyScrollDidEnd() >+{ >+ m_scrollableArea.addPendingScrollEndEventTarget(); >+} >+#endif >+ > void ScrollAnimatorMac::updateScrollerStyle() > { > if ([m_scrollerImpPair overlayScrollerStateIsLocked]) { >diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp >index 0337c00c67..832047247e 100644 >--- a/Source/WebCore/rendering/RenderBox.cpp >+++ b/Source/WebCore/rendering/RenderBox.cpp >@@ -989,6 +989,16 @@ RenderBox* RenderBox::findAutoscrollable(RenderObject* renderer) > return is<RenderBox>(renderer) ? downcast<RenderBox>(renderer) : nullptr; > } > >+void RenderBox::stopAutoscroll() >+{ >+#if ENABLE(OVERSCROLL_EVENTS) >+ if (isRenderView() && frame().view()) >+ frame().view()->notifyUserScrollActionEnd(); >+ else if (layer()) >+ layer()->notifyUserScrollActionEnd(); >+#endif >+} >+ > void RenderBox::panScroll(const IntPoint& source) > { > if (layer()) >diff --git a/Source/WebCore/rendering/RenderBox.h b/Source/WebCore/rendering/RenderBox.h >index d087d3f64f..3e256daa22 100644 >--- a/Source/WebCore/rendering/RenderBox.h >+++ b/Source/WebCore/rendering/RenderBox.h >@@ -473,7 +473,7 @@ override; > bool canAutoscroll() const; > IntSize calculateAutoscrollDirection(const IntPoint& windowPoint) const; > static RenderBox* findAutoscrollable(RenderObject*); >- virtual void stopAutoscroll() { } >+ virtual void stopAutoscroll(); > virtual void panScroll(const IntPoint&); > > bool hasVerticalScrollbarWithAutoBehavior() const; >diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp >index 4e71745062..1d0610cf92 100644 >--- a/Source/WebCore/rendering/RenderLayer.cpp >+++ b/Source/WebCore/rendering/RenderLayer.cpp >@@ -2590,10 +2590,12 @@ void RenderLayer::scrollToYPosition(int y, ScrollType scrollType, ScrollClamping > > void RenderLayer::setScrollPosition(const ScrollPosition& position, ScrollType scrollType, ScrollClamping clamping, AnimatedScroll animated) > { >+ auto offset = scrollOffsetFromPosition(position); >+ ScrollOffset newScrollOffset = clamping == ScrollClamping::Clamped ? clampScrollOffset(offset) : offset; > if (animated == AnimatedScroll::Yes) >- scrollToOffsetWithAnimation(scrollOffsetFromPosition(position), scrollType, clamping); >+ scrollToOffsetWithAnimation(newScrollOffset, scrollType, clamping); > else >- scrollToOffset(scrollOffsetFromPosition(position), scrollType, clamping); >+ scrollToOffset(newScrollOffset, scrollType, clamping); > } > > ScrollOffset RenderLayer::clampScrollOffset(const ScrollOffset& scrollOffset) const >@@ -2618,16 +2620,22 @@ void RenderLayer::scrollToOffset(const ScrollOffset& scrollOffset, ScrollType sc > scrollAnimator().cancelAnimations(); > > ScrollOffset clampedScrollOffset = clamping == ScrollClamping::Clamped ? clampScrollOffset(scrollOffset) : scrollOffset; >+ ScrollPosition clampedScrollPosition = scrollPositionFromOffset(clampedScrollOffset); > if (clampedScrollOffset == this->scrollOffset()) > return; > > auto previousScrollType = currentScrollType(); > setCurrentScrollType(scrollType); > >- if (!requestScrollPositionUpdate(scrollPositionFromOffset(clampedScrollOffset), scrollType, clamping)) >+ if (!requestScrollPositionUpdate(clampedScrollPosition, scrollType, clamping)) > scrollToOffsetWithoutAnimation(clampedScrollOffset, clamping); >- setScrollBehaviorStatus(ScrollBehaviorStatus::NotInAnimation); > >+#if ENABLE(OVERSCROLL_EVENTS) >+ if (currentScrollType() == ScrollType::User) >+ setRequestingUserScrollPosition(clampedScrollPosition); >+#endif >+ >+ setScrollBehaviorStatus(ScrollBehaviorStatus::NotInAnimation); > setCurrentScrollType(previousScrollType); > } > >@@ -2748,6 +2756,10 @@ void RenderLayer::scrollTo(const ScrollPosition& position) > if (Element* element = renderer().element()) > element->document().addPendingScrollEventTarget(*element); > >+#if ENABLE(OVERSCROLL_EVENTS) >+ checkUserScrollEndPosition(); >+#endif >+ > if (scrollsOverflow()) > view.frameView().didChangeScrollOffset(); > >@@ -2800,7 +2812,7 @@ void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insid > LayoutRect newRect = absoluteRect; > FrameView& frameView = renderer().view().frameView(); > auto* parentLayer = enclosingContainingBlockLayer(*this, CrossFrameBoundaries::No); >- bool autoscrollNotInProgress = !renderer().frame().eventHandler().autoscrollInProgress(); >+ bool autoscrollInProgress = renderer().frame().eventHandler().autoscrollInProgress(); > > if (allowsCurrentScroll()) { > // Don't scroll to reveal an overflow layer that is restricted by the -webkit-line-clamp property. >@@ -2820,9 +2832,11 @@ void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insid > if (clampedScrollOffset != scrollOffset() || currentScrollBehaviorStatus() != ScrollBehaviorStatus::NotInAnimation) { > ScrollOffset oldScrollOffset = scrollOffset(); > AnimatedScroll animated = AnimatedScroll::No; >- if (autoscrollNotInProgress && useSmoothScrolling(options.behavior, box->element())) >+ if (!autoscrollInProgress && useSmoothScrolling(options.behavior, box->element())) > animated = AnimatedScroll::Yes; >- setScrollPosition(scrollPositionFromOffset(clampedScrollOffset), ScrollType::Programmatic, ScrollClamping::Clamped, animated); >+ setScrollPosition(scrollPositionFromOffset(clampedScrollOffset), currentScrollType(), ScrollClamping::Clamped, animated); >+ if (autoscrollInProgress) >+ setRequestingUserScrollPosition(clampedScrollOffset); > IntSize scrollOffsetDifference = clampedScrollOffset - oldScrollOffset; > localExposeRect.move(-scrollOffsetDifference); > newRect = LayoutRect(box->localToAbsoluteQuad(FloatQuad(FloatRect(localExposeRect)), UseTransforms).boundingBox()); >@@ -2849,11 +2863,13 @@ void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insid > // FIXME: Should we use contentDocument()->scrollingElement()? > // See https://bugs.webkit.org/show_bug.cgi?id=205059 > AnimatedScroll animated = AnimatedScroll::No; >- if (autoscrollNotInProgress >+ if (!autoscrollInProgress > && ownerElement->contentDocument() > && useSmoothScrolling(options.behavior, ownerElement->contentDocument()->documentElement())) > animated = AnimatedScroll::Yes; > frameView.setScrollPosition(scrollPosition, ScrollClamping::Clamped, animated); >+ if (autoscrollInProgress) >+ frameView.setRequestingUserScrollPosition(scrollPosition); > > if (options.shouldAllowCrossOriginScrolling == ShouldAllowCrossOriginScrolling::Yes || frameView.safeToPropagateScrollToParent()) { > if (auto* enclosingLayer = ownerElement->renderer()->enclosingLayer()) >@@ -2896,9 +2912,11 @@ void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insid > // FIXME: Should we use document()->scrollingElement()? > // See https://bugs.webkit.org/show_bug.cgi?id=205059 > AnimatedScroll animated = AnimatedScroll::No; >- if (autoscrollNotInProgress && useSmoothScrolling(options.behavior, renderer().document().documentElement())) >+ if (!autoscrollInProgress && useSmoothScrolling(options.behavior, renderer().document().documentElement())) > animated = AnimatedScroll::Yes; > frameView.setScrollPosition(clampedScrollPosition, ScrollClamping::Clamped, animated); >+ if (autoscrollInProgress) >+ frameView.setRequestingUserScrollPosition(clampedScrollPosition); > } > > // This is the outermost view of a web page, so after scrolling this view we >@@ -4157,7 +4175,13 @@ bool RenderLayer::hitTestOverflowControls(HitTestResult& result, const IntPoint& > > bool RenderLayer::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier) > { >- return ScrollableArea::scroll(direction, granularity, multiplier); >+ if (ScrollableArea::scroll(direction, granularity, multiplier)) { >+#if ENABLE(OVERSCROLL_EVENTS) >+ notifyUserScrollActionEnd(); >+#endif >+ return true; >+ } >+ return false; > } > > void RenderLayer::paint(GraphicsContext& context, const LayoutRect& damageRect, const LayoutSize& subpixelOffset, OptionSet<PaintBehavior> paintBehavior, RenderObject* subtreePaintRoot, OptionSet<PaintLayerFlag> paintFlags, SecurityOriginPaintPolicy paintPolicy, EventRegionContext* eventRegionContext) >@@ -7036,6 +7060,52 @@ bool RenderLayer::invalidateEventRegion(EventRegionInvalidationReason reason) > #endif > } > >+#if ENABLE(OVERSCROLL_EVENTS) >+void RenderLayer::addPendingScrollEndEventTarget() >+{ >+ if (Element* element = renderer().element()) >+ element->document().addPendingScrollEndEventTarget(*element); >+} >+ >+void RenderLayer::setRequestingUserScrollPosition(const ScrollPosition& position) >+{ >+ if (!renderer().settings().overscrollEventsEnabled()) >+ return; >+ >+ m_requestingUserScrollPosition = position; >+} >+ >+void RenderLayer::notifyUserScrollActionEnd() >+{ >+ if (!renderer().settings().overscrollEventsEnabled()) >+ return; >+ >+ if (scrollAnimator().isScrollAnimationHelperInProgress()) >+ return; >+ >+ m_isUserScrollActionEnd = true; >+ checkUserScrollEndPosition(); >+} >+ >+void RenderLayer::checkUserScrollEndPosition() >+{ >+ if (!renderer().settings().overscrollEventsEnabled()) >+ return; >+ >+ if (!m_requestingUserScrollPosition) { >+ m_isUserScrollActionEnd = false; >+ return; >+ } >+ >+ if (!m_isUserScrollActionEnd || m_requestingUserScrollPosition.value() != scrollPosition()) >+ return; >+ >+ addPendingScrollEndEventTarget(); >+ m_requestingUserScrollPosition = WTF::nullopt; >+ m_isUserScrollActionEnd = false; >+} >+#endif >+ > TextStream& operator<<(WTF::TextStream& ts, ClipRectsType clipRectsType) > { > switch (clipRectsType) { >diff --git a/Source/WebCore/rendering/RenderLayer.h b/Source/WebCore/rendering/RenderLayer.h >index 5f54d0ec3b..2f34046648 100644 >--- a/Source/WebCore/rendering/RenderLayer.h >+++ b/Source/WebCore/rendering/RenderLayer.h >@@ -932,6 +932,14 @@ public: > > String debugDescription() const final; > >+#if ENABLE(OVERSCROLL_EVENTS) >+ void addPendingScrollEndEventTarget() final; >+ >+ void setRequestingUserScrollPosition(const ScrollPosition&) final; >+ void notifyUserScrollActionEnd() final; >+ void checkUserScrollEndPosition() final; >+#endif >+ > private: > > void setNextSibling(RenderLayer* next) { m_next = next; } >@@ -1371,6 +1379,11 @@ private: > > std::unique_ptr<RenderLayerFilters> m_filters; > std::unique_ptr<RenderLayerBacking> m_backing; >+ >+#if ENABLE(OVERSCROLL_EVENTS) >+ Optional<ScrollPosition> m_requestingUserScrollPosition; >+ bool m_isUserScrollActionEnd { false }; >+#endif > > PaintFrequencyTracker m_paintFrequencyTracker; > }; >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 2f1b7e5119..7807e9044e 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,17 @@ >+2020-04-09 Cathie Chen <cathiechen@igalia.com> >+ >+ Add support for overscroll events parsing >+ https://bugs.webkit.org/show_bug.cgi?id=208802 >+ >+ Reviewed by Frédéric Wang. >+ >+ Based on Frédéric Wang's patch. >+ >+ Add ENABLE_OVERSCROLL_EVENTS. >+ >+ * Configurations/FeatureDefines.xcconfig: >+ * Shared/WebPreferences.yaml: >+ > 2020-07-10 Carlos Garcia Campos <cgarcia@igalia.com> > > [GTK] Flush the cairo surface after painting when using software >diff --git a/Source/WebKit/Shared/WebPreferences.yaml b/Source/WebKit/Shared/WebPreferences.yaml >index e04cadca2d..88d0db2b1b 100644 >--- a/Source/WebKit/Shared/WebPreferences.yaml >+++ b/Source/WebKit/Shared/WebPreferences.yaml >@@ -1621,6 +1621,14 @@ AspectRatioOfImgFromWidthAndHeightEnabled: > humanReadableDescription: "Map HTML attributes width/height to the default aspect ratio of <img>" > category: experimental > >+OverscrollEventsEnabled: >+ type: bool >+ defaultValue: false >+ humanReadableName: "Overscroll events" >+ humanReadableDescription: "Enable the onscrollend and scrollend events" >+ category: experimental >+ condition: ENABLE(OVERSCROLL_EVENTS) >+ > # For internal features: > # The type should be boolean. > # You must provide a humanReadableName and humanReadableDescription for all debug features. They >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 1a6160e3b0..677bae1b58 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,23 @@ >+2020-04-09 Cathie Chen <cathiechen@igalia.com> >+ >+ Add support for overscroll events parsing >+ https://bugs.webkit.org/show_bug.cgi?id=208802 >+ >+ Reviewed by Frédéric Wang. >+ >+ Based on Frédéric Wang's patch. >+ >+ Add overscrollEventsEnabled WebPreference setting. >+ >+ * Configurations/FeatureDefines.xcconfig: >+ * WebView/WebPreferenceKeysPrivate.h: >+ * WebView/WebPreferences.mm: >+ ([WebPreferences initialize]): >+ (-[WebPreferences overscrollEventsEnabled]): >+ (-[WebPreferences setOverscrollEventsEnabled:]): >+ * WebView/WebPreferencesPrivate.h: >+ * WebView/WebView.mm: >+ > 2020-07-09 Brian Burg <bburg@apple.com> > > REGRESSION(r217248): ASSERT_NOT_REACHED() in toWebFrameLoadType() >diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h b/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h >index bdaa5c7209..e922ab3b30 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h >+++ b/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h >@@ -212,6 +212,7 @@ > #define WebKitCSSShadowPartsEnabledPreferenceKey @"WebKitCSSShadowPartsEnabled" > #define WebKitLayoutFormattingContextIntegrationEnabledPreferenceKey @"WebKitLayoutFormattingContextIntegrationEnabled" > #define WebKitWebSQLEnabledPreferenceKey @"WebKitWebSQLEnabled" >+#define WebKitOverscrollEventsEnabledPreferenceKey @"WebKitOverscrollEventsEnabled" > > #if !TARGET_OS_IPHONE > // These are private both because callers should be using the cover methods and because the >diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm b/Source/WebKitLegacy/mac/WebView/WebPreferences.mm >index 868bc610c8..8054acef06 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebPreferences.mm >@@ -716,6 +716,9 @@ public: > @NO, WebKitDebugInAppBrowserPrivacyEnabledPreferenceKey, > @NO, WebKitAspectRatioOfImgFromWidthAndHeightEnabledPreferenceKey, > @(webSQLEnabled), WebKitWebSQLEnabledPreferenceKey, >+#if ENABLE(OVERSCROLL_EVENTS) >+ @NO, WebKitOverscrollEventsEnabledPreferenceKey, >+#endif > nil]; > > #if !PLATFORM(IOS_FAMILY) >@@ -3701,6 +3704,16 @@ static NSString *classIBCreatorID = nil; > [self _setBoolValue:webSQLEnabled forKey:WebKitWebSQLEnabledPreferenceKey]; > } > >+- (BOOL)overscrollEventsEnabled >+{ >+ return [self _boolValueForKey:WebKitOverscrollEventsEnabledPreferenceKey]; >+} >+ >+- (void)setOverscrollEventsEnabled:(BOOL)flag >+{ >+ [self _setBoolValue:flag forKey:WebKitOverscrollEventsEnabledPreferenceKey]; >+} >+ > @end > > @implementation WebPreferences (WebInternal) >diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h b/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h >index 4fa7383d63..b833f96ca7 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h >+++ b/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h >@@ -694,6 +694,7 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR > @property (nonatomic) BOOL asyncClipboardAPIEnabled; > @property (nonatomic) BOOL linkPreloadResponsiveImagesEnabled; > @property (nonatomic) BOOL aspectRatioOfImgFromWidthAndHeightEnabled; >+@property (nonatomic) BOOL overscrollEventsEnabled; > > #if TARGET_OS_IPHONE > @property (nonatomic) BOOL quickLookDocumentSavingEnabled; >diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm >index 85d6943e36..fe5d8a7e25 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm >@@ -3184,6 +3184,9 @@ static bool needsSelfRetainWhileLoadingQuirk() > settings.setCSSOMViewScrollingAPIEnabled([preferences CSSOMViewScrollingAPIEnabled]); > settings.setCSSOMViewSmoothScrollingEnabled([preferences CSSOMViewSmoothScrollingEnabled]); > settings.setMediaContentTypesRequiringHardwareSupport([preferences mediaContentTypesRequiringHardwareSupport]); >+#if ENABLE(OVERSCROLL_EVENTS) >+ settings.setOverscrollEventsEnabled([preferences overscrollEventsEnabled]); >+#endif > > switch ([preferences storageBlockingPolicy]) { > case WebAllowAllStorage: >diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog >index 2646fb9289..afc5943bd6 100644 >--- a/Source/WebKitLegacy/win/ChangeLog >+++ b/Source/WebKitLegacy/win/ChangeLog >@@ -1,3 +1,24 @@ >+2020-04-09 Cathie Chen <cathiechen@igalia.com> >+ >+ Add support for overscroll events parsing >+ https://bugs.webkit.org/show_bug.cgi?id=208802 >+ >+ Reviewed by Frédéric Wang. >+ >+ Based on Frédéric Wang's patch. >+ >+ Add overscrollEventsEnabled WebPreference setting. >+ >+ * Interfaces/IWebPreferencesPrivate.idl: >+ * WebPreferenceKeysPrivate.h: >+ * WebPreferences.cpp: >+ (WebPreferences::initializeDefaultSettings): >+ (WebPreferences::overscrollEventsEnabled): >+ (WebPreferences::setOverscrollEventsEnabled): >+ * WebPreferences.h: >+ * WebView.cpp: >+ (WebView::notifyPreferencesChanged): >+ > 2020-07-07 Sam Weinig <weinig@apple.com> > > Part 2 of SimpleColor and SRGBA<uint8_t> are essentially the same - let's converge them >diff --git a/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl b/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl >index 9a875d479e..9b0f02ad1e 100644 >--- a/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl >+++ b/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl >@@ -267,6 +267,11 @@ interface IWebPreferencesPrivate8 : IWebPreferencesPrivate7 > { > HRESULT allowTopNavigationToDataURLs([out, retval] BOOL* enabled); > HRESULT setAllowTopNavigationToDataURLs([in] BOOL enabled); >+ > HRESULT modernUnprefixedWebAudioEnabled([out, retval] BOOL* enabled); > HRESULT setModernUnprefixedWebAudioEnabled([in] BOOL enabled); >+ >+ HRESULT overscrollEventsEnabled([out, retval] BOOL*); >+ HRESULT setOverscrollEventsEnabled([in] BOOL enabled); >+ > } >diff --git a/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h b/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h >index 2a2121adb9..1de2b62b7d 100644 >--- a/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h >+++ b/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h >@@ -231,3 +231,5 @@ > #define WebKitAspectRatioOfImgFromWidthAndHeightEnabledPreferenceKey "WebKitAspectRatioOfImgFromWidthAndHeightEnabled" > > #define WebKitWebSQLEnabledPreferenceKey "WebKitWebSQLEnabled" >+ >+#define WebKitOverscrollEventsEnabledPreferenceKey "WebKitOverscrollEventsEnabled" >diff --git a/Source/WebKitLegacy/win/WebPreferences.cpp b/Source/WebKitLegacy/win/WebPreferences.cpp >index 93de8a320a..d0b7d4383f 100644 >--- a/Source/WebKitLegacy/win/WebPreferences.cpp >+++ b/Source/WebKitLegacy/win/WebPreferences.cpp >@@ -357,6 +357,8 @@ void WebPreferences::initializeDefaultSettings() > > CFDictionaryAddValue(defaults, CFSTR(WebKitWebSQLEnabledPreferenceKey), kCFBooleanFalse); > >+ CFDictionaryAddValue(defaults, CFSTR(WebKitOverscrollEventsEnabledPreferenceKey), kCFBooleanFalse); >+ > defaultSettings = defaults; > #endif > } >@@ -2487,6 +2489,20 @@ HRESULT WebPreferences::setWebSQLEnabled(BOOL enabled) > return S_OK; > } > >+HRESULT WebPreferences::overscrollEventsEnabled(_Out_ BOOL* enabled) >+{ >+ if (!enabled) >+ return E_POINTER; >+ *enabled = boolValueForKey(WebKitOverscrollEventsEnabledPreferenceKey); >+ return S_OK; >+} >+ >+HRESULT WebPreferences::setOverscrollEventsEnabled(BOOL enabled) >+{ >+ setBoolValue(WebKitOverscrollEventsEnabledPreferenceKey, enabled); >+ return S_OK; >+} >+ > HRESULT WebPreferences::allowTopNavigationToDataURLs(_Out_ BOOL* allowAccess) > { > if (!allowAccess) >diff --git a/Source/WebKitLegacy/win/WebPreferences.h b/Source/WebKitLegacy/win/WebPreferences.h >index 2437b0e762..0bbc4be941 100644 >--- a/Source/WebKitLegacy/win/WebPreferences.h >+++ b/Source/WebKitLegacy/win/WebPreferences.h >@@ -305,9 +305,13 @@ public: > // IWebPreferencesPrivate8 > virtual HRESULT STDMETHODCALLTYPE allowTopNavigationToDataURLs(_Out_ BOOL*); > virtual HRESULT STDMETHODCALLTYPE setAllowTopNavigationToDataURLs(BOOL); >+ > virtual HRESULT STDMETHODCALLTYPE modernUnprefixedWebAudioEnabled(_Out_ BOOL*); > virtual HRESULT STDMETHODCALLTYPE setModernUnprefixedWebAudioEnabled(BOOL); > >+ virtual HRESULT STDMETHODCALLTYPE overscrollEventsEnabled(_Out_ BOOL*); >+ virtual HRESULT STDMETHODCALLTYPE setOverscrollEventsEnabled(BOOL); >+ > // WebPreferences > > // This method accesses a different preference key than developerExtrasEnabled. >diff --git a/Source/WebKitLegacy/win/WebView.cpp b/Source/WebKitLegacy/win/WebView.cpp >index 67fe641375..b1b5564293 100644 >--- a/Source/WebKitLegacy/win/WebView.cpp >+++ b/Source/WebKitLegacy/win/WebView.cpp >@@ -5680,6 +5680,11 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification) > return hr; > settings.setAspectRatioOfImgFromWidthAndHeightEnabled(!!enabled); > >+ hr = prefsPrivate->overscrollEventsEnabled(&enabled); >+ if (FAILED(hr)) >+ return hr; >+ settings.setOverscrollEventsEnabled(!!enabled); >+ > return S_OK; > } > >diff --git a/Source/cmake/WebKitFeatures.cmake b/Source/cmake/WebKitFeatures.cmake >index 83fc817279..d81cf74cf7 100644 >--- a/Source/cmake/WebKitFeatures.cmake >+++ b/Source/cmake/WebKitFeatures.cmake >@@ -185,6 +185,7 @@ macro(WEBKIT_OPTION_BEGIN) > WEBKIT_OPTION_DEFINE(ENABLE_THUNDER "Toggle EME V3 Thunder support" PRIVATE OFF) > WEBKIT_OPTION_DEFINE(ENABLE_ORIENTATION_EVENTS "Toggle Orientation Events support" PRIVATE OFF) > WEBKIT_OPTION_DEFINE(ENABLE_OVERFLOW_SCROLLING_TOUCH "Toggle accelerated scrolling support" PRIVATE OFF) >+ WEBKIT_OPTION_DEFINE(ENABLE_OVERSCROLL_EVENTS "Toggle overscroll events" PRIVATE ON) > WEBKIT_OPTION_DEFINE(ENABLE_PAYMENT_REQUEST "Toggle Payment Request support" PRIVATE OFF) > WEBKIT_OPTION_DEFINE(ENABLE_PDFKIT_PLUGIN "Toggle PDFKit plugin support" PRIVATE OFF) > WEBKIT_OPTION_DEFINE(ENABLE_PERIODIC_MEMORY_MONITOR "Toggle periodical memory monitor support" PRIVATE OFF) >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index afefc55c8e..cb1650194f 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,23 @@ >+2020-04-09 Cathie Chen <cathiechen@igalia.com> >+ >+ Add support for overscroll events parsing >+ https://bugs.webkit.org/show_bug.cgi?id=208802 >+ >+ Reviewed by Frédéric Wang. >+ >+ Based on Frédéric Wang's patch. >+ >+ Deal with overscrollEventsEnabled. >+ >+ * DumpRenderTree/TestOptions.cpp: >+ (TestOptions::TestOptions): >+ * DumpRenderTree/TestOptions.h: >+ * DumpRenderTree/mac/DumpRenderTree.mm: >+ (enableExperimentalFeatures): >+ (setWebPreferencesForTestOptions): >+ * Scripts/webkitperl/FeatureList.pm: >+ * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: >+ > 2020-07-10 Xabier Rodriguez Calvar <calvaris@igalia.com> > > [GStreamer][EME][OpenCDM] Implement OpenCDM support >diff --git a/Tools/DumpRenderTree/TestOptions.cpp b/Tools/DumpRenderTree/TestOptions.cpp >index e7c5836782..6b64c02c9e 100644 >--- a/Tools/DumpRenderTree/TestOptions.cpp >+++ b/Tools/DumpRenderTree/TestOptions.cpp >@@ -158,6 +158,8 @@ TestOptions::TestOptions(const std::string& pathOrURL, const std::string& absolu > enableAspectRatioOfImgFromWidthAndHeight = parseBooleanTestHeaderValue(value); > else if (key == "allowTopNavigationToDataURLs") > allowTopNavigationToDataURLs = parseBooleanTestHeaderValue(value); >+ else if (key == "experimental:OverscrollEventsEnabled") >+ enableOverscrollEvents = parseBooleanTestHeaderValue(value); > pairStart = pairEnd + 1; > } > } >diff --git a/Tools/DumpRenderTree/TestOptions.h b/Tools/DumpRenderTree/TestOptions.h >index c5c8c85992..27511e205b 100644 >--- a/Tools/DumpRenderTree/TestOptions.h >+++ b/Tools/DumpRenderTree/TestOptions.h >@@ -59,6 +59,7 @@ struct TestOptions { > bool enableAspectRatioOfImgFromWidthAndHeight { false }; > bool enableWebSQL { true }; > bool allowTopNavigationToDataURLs { true }; >+ bool enableOverscrollEvents { false }; > std::string jscOptions; > std::string additionalSupportedImageTypes; > >diff --git a/Tools/DumpRenderTree/mac/DumpRenderTree.mm b/Tools/DumpRenderTree/mac/DumpRenderTree.mm >index 87c04d92fa..a172df73c6 100644 >--- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm >+++ b/Tools/DumpRenderTree/mac/DumpRenderTree.mm >@@ -887,6 +887,7 @@ static void enableExperimentalFeatures(WebPreferences* preferences) > [preferences setCSSShadowPartsEnabled:YES]; > [preferences setAspectRatioOfImgFromWidthAndHeightEnabled:YES]; > [preferences setCSSOMViewSmoothScrollingEnabled:YES]; >+ [preferences setOverscrollEventsEnabled:YES]; > } > > // Called before each test. >@@ -1047,6 +1048,7 @@ static void setWebPreferencesForTestOptions(const TestOptions& options) > preferences.layoutFormattingContextIntegrationEnabled = options.layoutFormattingContextIntegrationEnabled; > preferences.aspectRatioOfImgFromWidthAndHeightEnabled = options.enableAspectRatioOfImgFromWidthAndHeight; > preferences.allowTopNavigationToDataURLs = options.allowTopNavigationToDataURLs; >+ preferences.overscrollEventsEnabled = options.enableOverscrollEvents; > } > > // Called once on DumpRenderTree startup. >diff --git a/Tools/Scripts/webkitperl/FeatureList.pm b/Tools/Scripts/webkitperl/FeatureList.pm >index 50dcd07d89..8566f9e363 100644 >--- a/Tools/Scripts/webkitperl/FeatureList.pm >+++ b/Tools/Scripts/webkitperl/FeatureList.pm >@@ -137,6 +137,7 @@ my ( > $thunderSupport, > $orientationEventsSupport, > $overflowScrollingTouchSupport, >+ $overscrollEventsSupport, > $paymentRequestSupport, > $pdfkitPluginSupport, > $pictureInPictureAPISupport, >@@ -454,6 +455,9 @@ my @features = ( > { option => "overflow-scrolling-touch", desc => "Toggle accelerated scrolling support", > define => "ENABLE_OVERFLOW_SCROLLING_TOUCH", value => \$overflowScrollingTouchSupport }, > >+ { option => "overscroll-events", desc => "Enable Overscroll Events support", >+ define => "ENABLE_OVERSCROLL_EVENTS", value => \$overscrollEventsSupport }, >+ > { option => "payment-request", desc => "Toggle Payment Request support", > define => "ENABLE_PAYMENT_REQUEST", value => \$paymentRequestSupport }, >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 208813
:
393835
|
393836
|
393839
|
393841
|
404830
|
404831
|
405452
|
405454