Wheel/touch events delivered to passive event listeners should have their `cancelable` property set to false.
<rdar://problem/71334287>
Note that Chrome does this, Gecko does not.
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?
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. """
Corresponding spec for Wheel events: https://w3c.github.io/uievents/#cancelability-of-wheel-events
I filed https://github.com/w3c/uievents/issues/282 on clarifying this for wheel events.
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.
Changing the event type based on the type of event listeners seem very strange & weird.
We'll do this now if the event starts in the passive event listener region.
Safari is failing quite a few tests: https://wpt.fyi/results/dom/events/non-cancelable-when-passive?label=master&label=experimental&aligned&view=subtest&q=non-cancelable