Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce "remove all event listeners" primitive #641

Merged
merged 2 commits into from
Apr 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,19 @@ method, when invoked, must run these steps:
<var>once</var>.
</ol>

<p>To <dfn>remove an event listener</dfn>, given an {{EventTarget}} object <var>eventTarget</var>
and an <a>event listener</a> <var>listener</var>, 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>.
<!-- Intentionally not exported. -->

<p>To <dfn export>remove all event listeners</dfn>, given an {{EventTarget}} object
<var>eventTarget</var>, <a for=list>for each</a> <var>listener</var> of <var>eventTarget</var>'s
<a for=EventTarget>event listener list</a>, <a>remove an event listener</a> with
<var>eventTarget</var> and <var>listener</var>.

<p class="note">HTML needs this to define <code>document.open()</code>. [[HTML]]

<p>The
<dfn method for=EventTarget><code>removeEventListener(<var>type</var>, <var>callback</var>, <var>options</var>)</code></dfn>
method, when invoked, must run these steps:
Expand All @@ -1117,9 +1130,8 @@ method, when invoked, must run these steps:
<li><p>If the <a>context object</a>'s <a for=EventTarget>event listener list</a>
<a for=list>contains</a> an <a>event listener</a> whose <a for="event listener">type</a> is
<var>type</var>, <a for="event listener">callback</a> is <var>callback</var>, and
<a for="event listener">capture</a> is <var>capture</var>, then set that <a>event listener</a>'s
<a for="event listener">removed</a> to true and <a for=list>remove</a> it from the
<a>context object</a>'s <a for=EventTarget>event listener list</a>.
<a for="event listener">capture</a> is <var>capture</var>, then <a>remove an event listener</a>
with the <a>context object</a> and that <a>event listener</a>.
</ol>

<p>The <dfn method for=EventTarget><code>dispatchEvent(<var>event</var>)</code></dfn> method, when
Expand Down