Re: Detecting and Creating Events

Sean Hogan <shogun70@westnet.com.au> wrote:

> Stewart Brodie wrote:
> > Garrett Smith <dhtmlkitchen@gmail.com> wrote:
> >
> >
> >> The inability to easily and accurately detect events is a problem.
> >> Programs want to know if an event is implemented at runtime. If it is,
> >> then the feature can be used. If not, it a fallback stratety is in
> >> order. Many new event types are being created and implemented. How can
> >> a program feature-test to see if they are implemented?
> >>
> >
> > DocumentEvent.canDispatch() would seem to fit the bill, although it's
> > not clear exactly what criteria this method is supposed to base its
> > answer on right now.  You could suggest a clarification for the text and
> > then you don't need to add all those new methods.
> >
> >
> Yes, can we have a clarification of the text. I would hope that if
> canDispatch() was already implemented in Firefox-3.5  then
> document.canDispatch("mouseenter") would return false.

Given the wording is totally ambiguous, as Garrett previously indicated, it
is perfectly at liberty to return true.  I also found the wording too vague
to even attempt implementing it, so I just left it out.  I interpreted it as
meaning that the implementation will return true if the event type passes
validation (i.e. isn't an empty string) on the basis that "it is able to
dispatch the event".  I couldn't see how some events could be dispatchable
but others not so.


-- 
Stewart Brodie
Software Engineer
ANT Software Limited

Received on Monday, 24 August 2009 09:19:54 UTC