Re: Passing JavaScript Function object to EventTarget.addEventListener()

Neil Deakin <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
Sergey Yanovich wrote:
> [1] specifies that the second argument taken by addEventListener to be 
> an EventListener instance. However, Mozilla accepts plain Function 
> objects just fine.
> 
> Could anyone provide any pointers why this works (is this a DOM feature 
> or an extension), and in which module this is implemented (dom, content, 
> or xpconnect maybe)?

Because in the idl source for nsIDOMEventListener (at 
http://mxr.mozilla.org/mozilla-central/source/dom/public/idl/events/nsIDOMEventListener.idl 
), the interface is marked with 'function'.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.