W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2010

Re: DOM event detection

From: Ryan Seddon <seddon.ryan@gmail.com>
Date: Wed, 22 Dec 2010 09:37:46 +1100
Message-ID: <AANLkTikX86W1Oon9W4gfRMSuUo1nzA6_gUBbZXOBMZZX@mail.gmail.com>
To: Robin Winslow <robin@robinwinslow.co.uk>
Cc: public-webapps@w3.org
It's actually a bug in Firefox[1] which unfortunately been around for a very
long time, since 2003, and isn't isolated just on the input event it also
affects the invalid event. For detecting events kangax has created a handy
method called isEventSupported[2] which will detect 99% of events
successfully, albeit not input or invalid events in FF due to the above
mentioned bug.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=195696
[2] http://kangax.github.com/iseventsupported/

-Ryan

On Tue, Dec 21, 2010 at 10:44 AM, Robin Winslow <robin@robinwinslow.co.uk>wrote:

> After a brief correspondence with Robin Berjon he suggested I post this
> suggestion here.
>
> After having problems with detecting support for the HTML5 'input' event (
> http://goo.gl/XNSg5 http://goo.gl/rAa5f) I started wondering if there was
> a DOM specification for detecting support for DOM events in browsers.
>
> After a brief email correspondence with Robin Berjon, and looking around a
> bit myself, it appears that there is no specific mention of this in the
> current HTML5 or DOM specifications. There is some mention of DOM events
> being exposed as methods (http://goo.gl/TYm2k) but this may not
> necessarily apply to all DOM elements.
>
> Therefore, I'd like to suggest that we try to come up with a standard way
> of suggesting that support for DOM elements be exposed, to enable developers
> to tell which events are supported.
>
> One method that works in Webkit and Gecko for many methods, although I
> don't think it's in any W3C specification, is to include methods for each
> event them in the "Event" object, e.g.:
>
> 'CLICK' in Event; // true
> 'CHANGE' in Event; // true
> 'INPUT' in Event; // false
>
> Does that seem like a reasonable method of DOM event support detection?
> Could it be included as a recommendation in the specification somewhere?
>
> Cheers,
> Robin.
>
Received on Tuesday, 21 December 2010 22:38:40 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:42 GMT