Bug 218860

Summary: Events delivered when all event listeners in the ancestor chain are passive should be cancelable=false
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: ahmad.saleem792, cdumez, emilio, rniwa, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: BrowserCompat, InRadar, WPTImpact
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=218861

Simon Fraser (smfr)
Reported 2020-11-12 11:09:54 PST
Wheel/touch events delivered to passive event listeners should have their `cancelable` property set to false.
Attachments
Radar WebKit Bug Importer
Comment 1 2020-11-12 11:10:19 PST
Simon Fraser (smfr)
Comment 2 2020-11-12 11:11:41 PST
Note that Chrome does this, Gecko does not.
Emilio Cobos Álvarez (:emilio)
Comment 3 2020-11-12 14:42:20 PST
Should the cancelability of the event really depend on the listener? What do we do for other events, or if there are both passive and non-passive listeners?
Chris Dumez
Comment 4 2020-11-12 14:56:52 PST
https://w3c.github.io/touch-events/#cancelability """ In particular, a user agent may generate only uncancelable touch events when it observes that there are no non-passive listeners for the event. """
Chris Dumez
Comment 5 2020-11-12 14:58:23 PST
Simon Fraser (smfr)
Comment 6 2020-11-12 15:08:08 PST
I filed https://github.com/w3c/uievents/issues/282 on clarifying this for wheel events.
Simon Fraser (smfr)
Comment 7 2020-11-12 16:09:32 PST
Looking at blink code, it appears (for touch events at least) to set the event to non-cancelable if all the event listeners in the ancestor chain of the target element have passive listeners. My testing suggests that the same is true for wheel event listeners.
Ryosuke Niwa
Comment 8 2020-11-12 21:33:15 PST
Changing the event type based on the type of event listeners seem very strange & weird.
Simon Fraser (smfr)
Comment 9 2020-12-03 15:05:47 PST
We'll do this now if the event starts in the passive event listener region.
Note You need to log in before you can comment on or make changes to this bug.