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

Re: [DOM4] EventTarget as first class citizen

From: Erik Arvidsson <arv@chromium.org>
Date: Mon, 5 Mar 2012 10:26:37 -0800
Message-ID: <CAJ8+Gojq==mF_Kd7NctYGKJB+Bxnsn6R-BYkQf8+3ho09NNJhg@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: Anne van Kesteren <annevk@opera.com>, Boris Zbarsky <bzbarsky@mit.edu>, Dimitri Glazkov <dglazkov@chromium.org>, www-dom@w3.org, Alex Russell <slightlyoff@google.com>
On Sat, Mar 3, 2012 at 15:40, Jonas Sicking <jonas@sicking.cc> wrote:
> Note, I don't think that anyone is suggesting to add
> .parentNode/.eventTargetParent to the EventTarget interface. But
> rather just to objects instantiated through the constructor described
> in this thread.

FWIW, some JS libraries have custom EventTarget implementations and
they use parentEventTarget as a way to determine how to do the
propagation.

One problem with only allowing the parent in the constructor is that
it becomes read only. Most use cases for custom EventTargets that
involve propagation also requires being able to reparent that objects.

> We can either do that by inserting another interface which just
> contains this new property. Or by adding the property on the instances
> themselves. I don't have a strong opinion either way, but it would
> seem nice if we can still call the constructor 'EventTarget'.

Another option is to allow manual propagation. It still requires that
the EventTarget is extended so maybe it is just simple to have a new
property?

-- 
erik
Received on Monday, 5 March 2012 18:27:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:09 GMT