DOM 3 Events: EventListeners and NodeFilters?

In recent weeks, I have tinkered with DOM Level 2 Traversal, and have 
discovered much fun to be had with NodeFilter objects. Yet, when I need to 
register an EventListener on an EventTarget, I find I must often use 
conventional DOM Core techniques to determine if the currentTarget or target 
of an Event the EventListener receives are appropriate for that 
EventListener. This is very inconveinient.

I would suggest adding new methods for "filtered" EventListener objects. 
They would correspond to the addEventListener and removeEventListener 
methods, but with two additional NodeFilter arguments for the Event object's 
target and currentTarget properties.

Because quite often only one of the two properties may matter, it would 
become necessary to suggest a special NodeFilter which always returns 
NodeFilter.FILTER_ACCEPT. This would allow the target property to be 
insignificant while the currentTarget is significant, or vice versa.

Opinions?

Alex Vincent
author, JavaScript Developer's Dictionary (Sams Publishing)
moderator, XML forum @ codingforums.com

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

Received on Wednesday, 5 February 2003 10:58:59 UTC