Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3c2f9abf7173b999417f7b09c02f4c91fb43615f
https://github.com/WebKit/WebKit/commit/3c2f9abf7173b999417f7b09c02f4c91fb43615f
Author: Chris Dumez <[email protected]>
Date: 2026-08-07 (Fri, 07 Aug 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/dom/events/scrolling/scroll-cross-origin-iframes-expected.txt
M LayoutTests/platform/mac-site-isolation/TestExpectations
M Source/WebCore/platform/ScrollAnimator.cpp
M Source/WebCore/platform/ScrollAnimator.h
Log Message:
-----------
scrollend event is not fired when wheel-scrolling a subframe
https://bugs.webkit.org/show_bug.cgi?id=321265
Reviewed by Darin Adler.
A subframe (and any scrollable area without an asynchronous scrolling node)
is wheel-scrolled synchronously on the main thread, driven by ScrollAnimator's
ScrollingEffectsController. When such a scroll ends, the controller calls
ScrollingEffectsControllerClient::didStopWheelEventScroll(), but ScrollAnimator
never overrode it, so the empty base implementation ran and ScrollableArea::
scrollDidEnd() was never called. As a result no scrollend event was dispatched
for main-thread wheel scrolls, even though the scroll (and scroll events) worked
correctly.
Areas with an async scrolling node were unaffected because their scrollend is
driven by the scrolling tree delegate (ScrollingTreeScrollingNodeDelegateMac),
which does implement didStopWheelEventScroll(). Programmatic/animated scrolls
were also fine because ScrollAnimator already overrides didStopAnimatedScroll()
to call scrollDidEnd().
Fix this by overriding didStopWheelEventScroll() in ScrollAnimator to call
scrollDidEnd(), mirroring didStopAnimatedScroll(). This covers both
gesture-phase
wheel ends and discrete mouse-wheel scrolls (via the scrollend timer). It cannot
double-fire: scrollDidEnd() is guarded by isAwaitingScrollend() and only runs
when a scroll actually occurred, and async-scrolled areas use a separate
ScrollingEffectsController instance.
This makes the imported WPT test scroll-cross-origin-iframes.html pass, which
previously timed out waiting for a scrollend handshake from the iframes.
No new tests, rebaselined existing WPT test that was previously timing out
in WebKit. This test is passing in both Chrome and Firefox already.
*
LayoutTests/imported/w3c/web-platform-tests/dom/events/scrolling/scroll-cross-origin-iframes-expected.txt:
* LayoutTests/platform/mac-site-isolation/TestExpectations:
* Source/WebCore/platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::didStopWheelEventScroll):
* Source/WebCore/platform/ScrollAnimator.h:
Canonical link: https://commits.webkit.org/318805@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications