W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2013

Re: Better event listeners

From: Glenn Maynard <glenn@zewt.org>
Date: Tue, 12 Feb 2013 08:23:56 -0600
Message-ID: <CABirCh-2HEcim8E7R9AcqRQpLaMexU2UGq8HQuNaB7Og+UUk2g@mail.gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: www-dom@w3.org
On Tue, Feb 12, 2013 at 7:58 AM, Anne van Kesteren <annevk@annevk.nl> wrote:

> On Tue, Feb 12, 2013 at 12:31 AM, Glenn Maynard <glenn@zewt.org> wrote:
> > I think this proposal needs more consideration.  It's a simple,
> consistent
> > overload of an existing API, instead of a new API.  I've been told that
> it's
> > "confusing", but not how or why.  It seems simple and obvious to me, so I
> > don't know how to address this.  It seems much simpler than having two
> > distinct event listener APIs.  It doesn't give a nice two-letter function
> > name, but that's not a reason to have two APIs (at most it simply means
> > making an alias).
>
> Overloading an existing API to make it work completely different
> simply does not seem like a good strategy. We should just map it to
> the same underlying concepts.
>

It doesn't work completely differently.  It works exactly the same.
addEventListener("click", func, true) would be exactly equivalent to
addEventListener("click", func, {capture: true}).

-- 
Glenn Maynard
Received on Tuesday, 12 February 2013 14:24:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 12 February 2013 14:24:25 GMT