testing for event sensitivity and local declaration in the DOM

[Information that may be useful for Thursday's meeting. - Al]

The current drafts of the Event Target interface in the DOM Events definition for DOM3 adds two new methods, canTrigger and isRegisteredHere.  These were introduced as a response to requests from the WAI.

WAI reference:

<quote cite="http://lists.w3.org/Archives/Public/w3c-wai-ua/2002JanMar/0032.html">

1. Resolved
There will be two boolean tests available on a node for event
handlers.  One to test if a node will respond to a particular event (node
is in the event path) and one to test if the event handler is actually on
this specific node.

Action DOM: DOM working group will return with the specifications for UAAG
review

</quote>

DOM reference:

<quote cite="http://www.w3.org/TR/2002/WD-DOM-Level-3-Events-20020208/events.html#Events-EventTarget">

--
              canTrigger introduced in DOM Level 3

   This method allows the DOM application to know if an event listener,
   attached to this EventTarget or one of its ancestors, will be
   triggered by the specified event type during the dispatch of the event
   to this event target or one of its descendants. Parameters

                    type of type DOMString
                            The event type for which the
                            [136]EventListener is registered.

   Return Value
   boolean
   true if an event listener will be triggered on the event target with
   the specified event type, false otherwise.
   No Exceptions

--
              isRegisteredHere introduced in DOM Level 3

   This method allows the DOM application to know if this event target
   contains an event listener registered for the specified event type.
   This is useful for determining at which nodes within a hierarchy
   altered handling of specific event types has been introduced, but
   should not be used to determine whether the specified event type
   triggers a listener (see canTrigger).

                    Issue canTriggerOnTarget-useCapture:
                            do we need a useCapture parameter?
                            Resolution: No use case for that.

   Parameters

                    type of type DOMString
                            The event type for which the
                            [141]EventListener is registered.

   Return Value
   boolean
   true if an event listener is registered on this EventTarget for the
   specified event type, false otherwise.

--

The DOM working group believes that these method specifications answer the above action item.  

Al

Received on Tuesday, 26 March 2002 11:49:41 UTC