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

> @@ -1057,6 +1096,25 @@ invoked, must run these steps:
>   <li><p><a>Dispatch</a> the <var>event</var> and return the value that returns.
>  </ol>
>  
> +<h3 id=observing-event-listeners>Observing event listeners</h3>
> +In general, developers do not expect the presence of an <a>event listener</a> to be
> +observable.  The impact of an <a>event listener</a> is determined by its <b>callback</b>.
> +That is, a developer adding a no-op <a>event listener</a> would not expect it to have
> +any side effects.
> +
> +Unfortunately, some event APIs have been designed such that implementing them
> +efficiently requires observing <a>event listeners</a>.  For example, sensor APIs which
> +enable an underlying device sensor, and touch APIs which can be used to block

Implementing them efficiently is not really sufficient motivation. Not executing code that cannot be observed is always fine. What is problematic is when it can be observed that adding and removing listeners has an effect. That is already the case with touch events as I understand it and therefore we are doing this, so we should use that as motivation, no?

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

Received on Tuesday, 15 December 2015 10:16:56 UTC