W3C home > Mailing lists > Public > public-webapi@w3.org > March 2006

Re: ACTION-70: Define the scope chain of onFoo events reference issue-1

From: Maciej Stachowiak <mjs@apple.com>
Date: Wed, 15 Mar 2006 13:32:23 -0800
Message-Id: <191127F9-AB91-482C-A141-6994322D7749@apple.com>
Cc: "Web APIs WG (public)" <public-webapi@w3.org>
To: Bjoern Hoehrmann <derhoermi@gmx.net>


On Mar 15, 2006, at 12:54 AM, Bjoern Hoehrmann wrote:

> * Maciej Stachowiak wrote:
>> 3) Event handler DOM properties have a function value. Getting the
>> property retrieves any event listener function previously set using
>> the property or corresponding markup attribute.
>
> We should not really refer to the Function objects represented by the
> onfoo="" and .onfoo attributes as listeners in the EventListener  
> sense,
> what you say above reads as if you could do something like
>
>   t.removeEventListener('click', t.onclick, false);
>
> which you can't without a preceding addEventListener call.

You are right, the terminology needs to be more clear. How about:

EventListener - an object that actually implements the EventListener  
interface (i.e. has a handleEvent method)

event listener function - a function to be passed to addEventListener  
(which behaves as if it is wrapped in an EventListener object as  
described in my proposal)

HTML event handler function - the function you get or set from onfoo  
DOM properties or created from element attributes - not the same
as an event listener, the behavior is as if you wrapped it in another  
function that checks return value and prevents default (or just a  
function that forwards to it if we decide we don't want the  
preventDefault stuff).

HTML attribute event handler function - the kind of HTML event  
handler function created from an element attribute, which has a  
parameter named event exposed to the attribute body, a special scope  
chain, etc

Regards,
Maciej
Received on Wednesday, 15 March 2006 21:32:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:53 GMT