Re: [dom] Add EventListenerOptions and passive event listeners (#82)

> +
> +<p>Unfortunately, some event APIs have been designed such that implementing them
> +efficiently requires observing <a>event listeners</a>.  This can make the presence
> +of listeners observable in that even empty listeners can have a dramatic performance impact
> +on the behavior of the application. For example, touch and wheel events which can be used to block
> +asynchronous scrolling.  In some cases this problem can be mitigated by specifying
> +the event to be {{Event/cancelable}} only when there is at least one
> +non-{{EventListenerOptions/passive}} listener.  For example, non-{{EventListenerOptions/passive}}
> +{{TouchEvent}} listeners must block scrolling, but if all listeners are {{EventListenerOptions/passive}} then
> +scrolling can be allowed to start <a>in parallel</a> by making the {{TouchEvent}}
> +uncancelable (so that calls to {{Event/preventDefault()}} are ignored).  So code
> +dispatching an event is able to observe the absence of non-{{EventListenerOptions/passive}}
> +listeners, and use that to clear the {{Event/cancelable}} property of the event
> +being dispatched.
> +
> +<p>Ideally, any new event types are defined such that they don't need this

Done.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/82/files#r48749596

Received on Monday, 4 January 2016 16:35:56 UTC