Bug 219960 - Scroll-chaining not triggering before complete end of overscroll
Summary: Scroll-chaining not triggering before complete end of overscroll
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Scrolling (show other bugs)
Version: Safari Technology Preview
Hardware: Mac (Intel) macOS 10.15
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-12-16 13:50 PST by Bruno Stasse
Modified: 2022-02-08 21:32 PST (History)
11 users (show)

See Also:


Attachments
Test case (1.16 KB, text/html)
2020-12-16 13:50 PST, Bruno Stasse
no flags Details
Patch (4.50 KB, patch)
2021-01-21 16:02 PST, Simon Fraser (smfr)
thorton: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bruno Stasse 2020-12-16 13:50:00 PST
Created attachment 416361 [details]
Test case

Safari Technology Preview 117, on macOS 10.15.7


When scrolling inside a scroll container, after reaching the end, the scroll does not propagate to the parent scroll container (whether it is another element or the page) as long as the overscroll is ongoing. The current scroll has to be perfectly still for scroll-chaining to happen.

See the attachment for a test case, also available here: https://output.jsbin.com/begomocugi

Steps to reproduce:
1. scroll down to the end of the outer scroll (to reach the inner scroll)
2. scroll down inside the inner scroll, then up until reaching the top edge
3. scroll up again BEFORE the end of the overscroll

Expected behaviour: the scroll should propagate to the outer scroll container as soon as a new "up" scroll happens, and the outer scroll container should scroll up as a consequence.
Result: the inner scroll container get scrolled again, persisting in its overscroll. You have to wait for the overscroll to end completely to be able to scroll out of it.

Scroll-chaining is thus made pretty unusable, as you have to wait for the overscroll to end in order to escape the current scroll context.


This didn't happen in previous macOS Safari version (at least before STP 116, which I didn't test).
To be noted: this problem has been present on iOS for a while. Not sure if I should create another bug for this?

This bug might be related to this other one, on nested scrolling: https://bugs.webkit.org/show_bug.cgi?id=219923
Maybe it can even be considered as the same? As this bug (scroll-chaining) is present on iOS but not the other (nested scrolling) one I considered them to be different.

As mentioned in the other bug, this might be a regression due to the recent changes on scrolling.
Comment 1 Simon Fraser (smfr) 2020-12-16 17:37:18 PST
There's a 100ms timeout to clear latching which I think is a bit too long.
Comment 2 Bruno Stasse 2020-12-21 08:00:50 PST
When is that timeout added exactly?

It feels like there is a timeout preventing scroll chaining *after* the end of the overscroll. This doesn't seem useful, as it should be possible to scroll out of the inner scroll way before that, *during* the overscroll.

If the user is overscrolling and scrolls again in the same direction, scroll chaining should take place right away. This is how it behaved before STP 117, and how it behaves in similar situations accross macOS and iOS native interfaces.

Now maybe there can be a short timeout between the start of the overscroll and the possibility to trigger scroll chaining with a new scroll gesture, but I don't think this is when the timeout is used at the moment?
Comment 3 Radar WebKit Bug Importer 2020-12-22 12:01:42 PST
<rdar://problem/72595521>
Comment 4 Simon Fraser (smfr) 2021-01-08 20:21:50 PST
Part of this is about ScrollController's behavior of ignoring momentum scrolls (m_ignoreMomentumScrolls) when we're done rubberbanding, but we continue to claim to handle the wheel events, which postpones releasing the latch.
Comment 5 Simon Fraser (smfr) 2021-01-21 16:02:19 PST
Created attachment 418095 [details]
Patch
Comment 6 Simon Fraser (smfr) 2021-01-21 18:52:18 PST
https://trac.webkit.org/changeset/271730/webkit
Comment 7 Simon Fraser (smfr) 2022-02-08 21:32:23 PST
I filed bug 236348 to followup on https://twitter.com/mtomweb/status/1491162786369777665