Re: DOM 3 Events last call comments

On Fri, 2002-08-02 at 13:40, Nathan Codding wrote:

We have been working on implementing DOM 3 Events in Xerces-C++, and
here are our comments on the draft:

CustomEvent interface:

The two methods in CustomEvent, setCurrentTarget() and setEventPhase(),
should be added to the Event interface for Level 3. In order for an
implementation to determine how to set the currentTarget and eventPhase
of an Event it is dispatching, it now needs to be able to tell if that
Event is actually a CustomEvent or not. This requires some form of
runtime type information. Xerces-C++ does not use RTTI, which makes this
determination impossible without adding a method/field to the Event
interface that can be used to determine the type of an Event (similar to
getNodeType() on Node).

We resolved the issue by adding an attribute on the Event interface: 

interface Event {
...
isCustom of type boolean, readonly

 This attribute will always return false, unless the event implements
 the CustomEvent interface. As for CustomEvents, this attribute is meant
 to be used by the DOM Events implementation (see Event creation).
}

Philippe

Received on Tuesday, 24 September 2002 16:30:28 UTC