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

DOM 3 Events: EventListeners and NodeFilters?

From: Alexander J. Vincent <ajvincent@hotmail.com>
Date: Wed, 05 Feb 2003 07:58:24 -0800
To: www-dom@w3.org
Message-ID: <F265ViME4MBwtpxeE3L00009f21@hotmail.com>

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.


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

Protect your PC - get McAfee.com VirusScan Online  
Received on Wednesday, 5 February 2003 10:58:59 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:11 UTC