Bug 239014

Summary: [Pointer events] pointerend/pointercancel event never fired when swiping to forwards a page
Product: WebKit Reporter: pfg.webkit
Component: UI EventsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: h.dodov, pfg.webkit, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: iPhone / iPad   
OS: iOS 15   
Attachments:
Description Flags
Pointer swipe bug demo none

Description pfg.webkit 2022-04-08 13:27:08 PDT
Reproduction:

1. Open this url: https://patrickhlauke.github.io/touch/gesture-touch/pointerevents.html
2. Navigate to any other url
3. Go back
4. Start swiping from the right edge of the screen to go forwards a page
5. Move your finger back to the right edge of the screen to cancel that
6. Notice that a pointerend/pointercancel event is never fired

I would expect a pointercancel event to be fired as soon as the page starts moving for the back/forwards animation, or at least when the finger is lifted, but one is never fired at all causing pages to get stuck expecting more events that never come.
Comment 1 Radar WebKit Bug Importer 2022-04-15 13:28:13 PDT
<rdar://problem/91825957>
Comment 2 Hristiyan Dodov 2022-04-16 03:26:09 PDT
Created attachment 457745 [details]
Pointer swipe bug demo
Comment 3 Hristiyan Dodov 2022-04-16 03:36:40 PDT
I can reproduce this issue on iPhone 12 mini, OS version 15.4.1.

Reproduction site:
https://safari-pointer-swipe-bug.netlify.app/

I've also attached a video that showcases the bug:
- Swiping from the left (go to previous page) correctly triggers `pointerdown`, then `pointerup` events.
- Swiping from the right (go to next page) correctly triggers `pointerdown`, but **incorrectly** does not trigger `pointerup` afterwards.

The OP expects `pointercancel` to be fired, but that would introduce an inconsistency with swiping from the left. It should be a `pointerup` event.