Created attachment 416298 [details] Test case Safari Technology Preview 117, on macOS 10.15.7 With one scroll container containing another scroll container. The outer one is set to overflow-x: auto, and the inner one to overflow-y: auto. See the attachment for a simple test case, also available here: https://output.jsbin.com/cuvehilufi Steps to reproduce: 1. scroll vertically (inner) with a trackpad 2. scroll horizontally (outer) with a trackpad BEFORE the end of the momentum, OR BEFORE the end of overscroll if you reach the end of the scroll container Expected behaviour: the outer container should scroll horizontally right away. Result: the scroll stutters and gets blocked. This happens in all directions, with the inner or the outer scroll. It didn't happen in the previous version of Safari (at least not until 116 which I didn't test). This makes nested scrolling pretty unusable, because you have to wait for the end of the momentum and overscroll to scroll in another direction. I guess this is a regression due to the recent changes on scrolling.
I can reproduce.
<rdar://problem/72390196>
I think this is because we re-compute latching for a "MayBegin" event (fingers down, stationary, on the trackpad) but not a "Begin" event (fingers down with movement).
Actually I think this is mainly triggered by: overflow-x: hidden; overflow-y: auto; when there is x-overflow.
I fixed at least some of the issues here in r271090.
I can still reproduce some issues though.
There are some issues here about what happens when we send a wheel event with x-axis deltas to a latched y-axis scroller, but the underlying cause of stuttering is that a latched scroller receives a stream of events for the cross axis and doesn't handle them, which causes the latch in ScrollingTreeLatchingController to time out, so at point we hit-test again and find a different scroller and start sending events to it.
Created attachment 418001 [details] Patch
Created attachment 418020 [details] Patch
Committed r271701: <https://trac.webkit.org/changeset/271701> All reviewed patches have been landed. Closing bug and clearing flags on attachment 418020 [details].