Bug 218860 - Events delivered when all event listeners in the ancestor chain are passive should be cancelable=false
Summary: Events delivered when all event listeners in the ancestor chain are passive s...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar, WPTImpact
Depends on:
Blocks:
 
Reported: 2020-11-12 11:09 PST by Simon Fraser (smfr)
Modified: 2022-09-12 14:40 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2020-11-12 11:09:54 PST
Wheel/touch events delivered to passive event listeners should have their `cancelable` property set to false.
Comment 1 Radar WebKit Bug Importer 2020-11-12 11:10:19 PST
<rdar://problem/71334287>
Comment 2 Simon Fraser (smfr) 2020-11-12 11:11:41 PST
Note that Chrome does this, Gecko does not.
Comment 3 Emilio Cobos Álvarez (:emilio) 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?
Comment 4 Chris Dumez 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.
"""
Comment 5 Chris Dumez 2020-11-12 14:58:23 PST
Corresponding spec for Wheel events:
https://w3c.github.io/uievents/#cancelability-of-wheel-events
Comment 6 Simon Fraser (smfr) 2020-11-12 15:08:08 PST
I filed https://github.com/w3c/uievents/issues/282 on clarifying this for wheel events.
Comment 7 Simon Fraser (smfr) 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.
Comment 8 Ryosuke Niwa 2020-11-12 21:33:15 PST
Changing the event type based on the type of event listeners seem very strange & weird.
Comment 9 Simon Fraser (smfr) 2020-12-03 15:05:47 PST
We'll do this now if the event starts in the passive event listener region.