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

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 UTC