From 8e5d463a9fa189d17b7707d40fa894c674fc87cc Mon Sep 17 00:00:00 2001 From: Gregory Terzian Date: Thu, 28 Jun 2018 18:45:46 +0800 Subject: [PATCH] define a "has listeners for" algorithm on EventTarget --- dom.bs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dom.bs b/dom.bs index ad8b27a3c..22ac054aa 100644 --- a/dom.bs +++ b/dom.bs @@ -995,6 +995,18 @@ and a legacy-canceled-activation behavior algo

These algorithms only exist for checkbox and radio <{input}> elements and are not to be used for anything else. [[!HTML]] +

Each {{EventTarget}} object also has an associated has listeners for algorithm, +which takes a type type, and returns a boolean. + +

To determine if a {{EventTarget}} object eventTarget +has listeners for a given type, run these steps: + +

    +
  1. If eventTarget's event listener list contains an + event listener whose type is type, return true. +

  2. Otherwise, return false. +

+
target = new EventTarget();

Creates a new {{EventTarget}} object, which can be used by developers to dispatch and