Bug 240892

Summary: Neither preventDefault on GestureEnd nor CSS overscroll stop the Safari "Tab Expose" feature or page navigation
Product: WebKit Reporter: Jarod Gowgiel <jarod.gowgiel>
Component: UI EventsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: Mac (Intel)   
OS: macOS 12   

Jarod Gowgiel
Reported 2022-05-24 16:09:37 PDT
When zooming out on a web page, Safari triggers a "Tab Expose" view as a result of overscroll, and when scrolling backwards or forwards triggers navigation. I'd expect that, similar to other gestures, calling preventDefault() on the resulting GestureEnd would prevent these system gestures from occurring, but that isn't the case. On iOS, it's a known workaround to preventDefault() on the touchstart event that begins the gesture, but similar workarounds (like preventDefault() on the mousedown) seem to not have the same effect on macOS in Safari from my experimentation. As an alternate approach, I also tried out overscroll-behavior. The specification for overscroll-behavior (which will be the [new default soon](https://bugs.webkit.org/show_bug.cgi?id=236060) and that I experimented with activating for myself locally via the "Experimental Features") states that "[contain] indicates that the element must not perform non-local boundary default actions such as scroll chaining or navigation." Even when applying "overscroll-behavior: contain" to an element, both of these non-local interactions (swiping backwards, and pinching to zoom) are still triggered.
Attachments
Sam Sneddon [:gsnedders]
Comment 1 2022-05-26 10:09:12 PDT
This sounds like another issue caused by Safari being in control of this UI behaviour without really knowing what's going on with the web content.
Jarod Gowgiel
Comment 2 2022-05-26 14:29:28 PDT
After some further experimentation, it seems like calling preventDefault() on the "wheel" event fired by Safari while panning around the trackpad does prevent page navigation, but has no impact on the "Tab Expose" gesture. "overscroll-behavior: contain" still seems to not stop either type of gesture, though.
Alexey Proskuryakov
Comment 3 2022-05-28 17:50:50 PDT
When considering changes in this area, we need to keep in mind whether preventing standard browser behaviors is user friendly. It often isn’t.
Radar WebKit Bug Importer
Comment 4 2022-05-31 16:10:13 PDT
Sam Sneddon [:gsnedders]
Comment 5 2022-08-04 08:54:31 PDT
*** This bug has been marked as a duplicate of bug 233141 ***
Note You need to log in before you can comment on or make changes to this bug.