W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2010

Re: Fwd: DOM event detection

From: Garrett Smith <dhtmlkitchen@gmail.com>
Date: Thu, 23 Dec 2010 18:39:01 -0800
Message-ID: <AANLkTinYf4VM-4kEZN_1yn5q+BkOOG5nPCUjrqawHtHU@mail.gmail.com>
To: Doug Schepers <schepers@w3.org>
Cc: Arthur Barstow <art.barstow@nokia.com>, www-dom <www-dom@w3.org>, robin@robinwinslow.co.uk
On 12/22/10, Doug Schepers <schepers@w3.org> wrote:
> Hi, Robin-
> Many people suggest a more active feature-testing approach (e.g. testing
> to see if an event will fire, or if a method exists), but I believe that
> the current draft of DOM3 Events meets your needs.  You can use the
> existing .hasFeature() method along with discrete event interface and
> event name feature strings to detect support for any event in a
> conforming DOM3 Events UA.
So, IOW, a program determines that the implementation is D3E
conforming by first calling:

document.implementation.hasFeature("Events", "3.0");

And then:


So in a nutshell:

var HAS_TEXTINPUT_EVENT = document.implementation
  && document.implementation.hasFeature
  && document.implementation.hasFeature("Events", "3.0")
  && document.implementation.hasFeature("Events.textInput");

Not very concise.

Do you have a URL for the discussion that led up to that change? TIA.

The feature, as it is written, doesn't give information for specific
objects. It will continue to be a problem for any new event. From your

| The extended feature string for each event type defined in DOM Level
| 3 Events shall be the base feature string “Events”, followed by the
| period character ("."), followed by the name of that event type, with
| the optional version string “3.0”, indicating that the user agent
| supports that specific event type in the manner described in the
| appropriate conformance section. For example, the feature string for
| the textInput event would be “Events.textInput”, with the optional
| version string “3.0”.

So what about other new events, e.g. the `textinput` event?
Received on Friday, 24 December 2010 02:39:35 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:16 UTC