Re: Fwd: DOM event detection

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:

document.implementation.hasFeature("Events.textinput");

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
draft:

| 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?
<http://lists.w3.org/Archives/Public/www-dom/2010OctDec/0106.html>
-- 
Garrett

Received on Friday, 24 December 2010 02:39:35 UTC