Skip to content

Commit

Permalink
define a "has listeners for" algorithm on EventTarget
Browse files Browse the repository at this point in the history
  • Loading branch information
gterzian committed Jun 28, 2018
1 parent 32efc48 commit 8e5d463
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,18 @@ and a <dfn export for=EventTarget>legacy-canceled-activation behavior</dfn> algo
<p class="note no-backref">These algorithms only exist for checkbox and radio <{input}> elements and
are not to be used for anything else. [[!HTML]]

<p>Each {{EventTarget}} object also has an associated <dfn export>has listeners for</dfn> algorithm,
which takes a <a for="event listener">type</a> <var>type</var>, and returns a <var>boolean</var>.

<p>To determine if a {{EventTarget}} object <var>eventTarget</var>
<dfn export>has listeners for</dfn> a given <var>type</var>, run these steps:

<ol>
<li><p>If <var>eventTarget</var>'s <a>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>, return true.
<li><p>Otherwise, return false.
</ol>

<dl class=domintro>
<dt><code><var>target</var> = new <a constructor for=EventTarget lt=EventTarget()>EventTarget</a>();</code>
<dd><p>Creates a new {{EventTarget}} object, which can be used by developers to <a>dispatch</a> and
Expand Down

0 comments on commit 8e5d463

Please sign in to comment.