W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2010

[whatwg] Mechanism to find available events

From: Jorge <jorge@jorgechamorro.com>
Date: Wed, 29 Dec 2010 12:07:19 +0100
Message-ID: <70BAE616-CC8D-4D61-B7D2-2E74F6074628@jorgechamorro.com>
On 29/12/2010, at 08:27, Ian Hickson wrote:
> On Mon, 20 Sep 2010, Biju wrote:
>> 
>> We need
>> HTMLNode.getSupportedEvents()  ==> returns a text array of event names
>> HTMLNode.isSupportedEvent(eventName)  ==> returns true/false
>> 
>> Many times in particular version of browser we dont know whether an
>> HTMLNode/window support particular event.
>> Or what are the alternate events available, so that we can refer some
>> document or do some test to find how it can be used.
>> So I wish we had above methods available.
> 
> What do you mean by "supports an event"? You can dispatch any event you 
> want to any event target.

It's not you, it's whether *the*browser* dispatches it. Say, oncontextmenu : "The code specified by this attribute is called when the associated element is right-clicked or when the mouse button is held down long enough to generate a contextual menu."

How could your program detect, unequivocally, that the browser it's running in would dispatch an oncontextmenu when "the element is right-clicked or when the mouse button is held down long enough to generate a contextual menu" ?

We need a mechanism to detect accurately the features of the browser our code's running in, without relying to UA sniffing madness.
-- 
Jorge.
Received on Wednesday, 29 December 2010 03:07:19 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:02 UTC