Re: [whatwg/dom] Editorial: move contains check into "remove an event listener" (#820)

shvaikalesh commented on this pull request.



> @@ -1196,9 +1196,13 @@ method, when invoked, must run these steps:
  <a>report a warning to the console</a> that this might not give the expected results.
  [[!SERVICE-WORKERS]]
 
- <li><p>Set <var>listener</var>'s <a for="event listener">removed</a> to true and
- <a for=list>remove</a> <var>listener</var> from <var>eventTarget</var>'s
- <a for=EventTarget>event listener list</a>.
+ <li><p>If <var>eventTarget</var>'s <a for=EventTarget>event listener list</a> does not
+ <a for=list>contain</a> an <a>event listener</a> whose <a for="event listener">type</a> is
+ <var>listener</var>'s <a for="event listener">type</a>, <a for="event listener">callback</a> is
+ <var>listener</var>'s <a for="event listener">callback</a>, and <a for="event listener">capture</a>
+ is <var>listener</var>'s <a for="event listener">capture</a>, then set <var>listener</var>'s
+ <a for="event listener">removed</a> to true and <a for=list>remove</a> <var>listener</var> from
+ <var>eventTarget</var>'s <a for=EventTarget>event listener list</a>.
 </ol>
 
 <p class=note>HTML needs this to define event handlers. [[HTML]]

Appended this note in a203af5 instead of HTML spec, so we can refer `contains` check more easily (as "above").

I was a bit hesitant to use "check above always no-ops" wording, as it may be understood as "listener is never found, so step 3 does nothing" and went with "always returns true".

-- 
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/820#discussion_r366904917

Received on Wednesday, 15 January 2020 14:29:27 UTC