Re: [whatwg/dom] Editorial: simplify EventListenerOptions processing (#492)

RByers commented on this pull request.



>  
- <li><p>If <var>options</var> is a boolean, set <var>capture</var> to <var>options</var>.
-
- <li><p>If <var>options</var> is a dictionary, then set <var>capture</var> to <var>options</var>'s
- <code>{{EventListenerOptions/capture}}</code>.
-
- <li><p>Return <var>capture</var>.
+ <li><p>Return <var>options</var>'s <code>{{EventListenerOptions/capture}}</code>.

This all looks nice (not sure why I thought the extra text was useful - sorry).

> @@ -894,8 +894,8 @@ for historical reasons.
 <pre class=idl>
 [Constructor, Exposed=(Window,Worker)]
 interface EventTarget {
-  void addEventListener(DOMString type, EventListener? callback, optional (AddEventListenerOptions or boolean) options);
-  void removeEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options);
+  void addEventListener(DOMString type, EventListener? callback, optional (AddEventListenerOptions or boolean) options = false);

Why make this change?

IIRC we discussed this on my original PR.  I could dig up the history but perhaps the argument against it was that it was observably identical to not specifying any default and instead relying on the dictionary defaults.  If behavior is indeed identical with or without this change, then I'd prefer we leave it out - the meaning when named `options` seems more explicit.  Also since we're now doing spec/impl IDL diffing, we'd want to get all the implementations to update which seems silly if there's no behavior difference whatsoever.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/492#pullrequestreview-56812920

Received on Thursday, 17 August 2017 02:43:55 UTC