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

>  method, when invoked, must run these steps:
>  
>  <ol>
>   <li><p>If <var>callback</var> is null, terminate these steps.
>  
> + <li>If <var>options</var> is of type boolean, let <var>capture</var> be
> + <var>options</var> and let <var>passive</var> be false.  Otherwise let
> + <var>capture</var> and <var>passive</var> be the corresponding values in the
> + <var>options</var> {{EventListenerOptions}} dictionary.

> Given we need this, why have default values in IDL?

Because we want to support cases like `addEventListener(t, h, {passive:true})` and `addEventListener(t, h, {capture:true})`.

> I would prefer initializing variables separately and then setting them based on the argument. I.e., use "let" once per variable name.

Ok.


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

Received on Tuesday, 15 December 2015 18:39:06 UTC