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: Mon, 27 Dec 2010 23:31:20 -0800
Message-ID: <AANLkTikf3iUhC24ZgdKLtRe0QLBZx4UmCvGqzc-X5JvX@mail.gmail.com>
To: Jacob Rossi <jrossi@microsoft.com>
Cc: "www-dom@w3.org" <www-dom@w3.org>, "schepers@w3.org" <schepers@w3.org>
On 12/27/10, Jacob Rossi <jrossi@microsoft.com> wrote:
> Garrett Smith:
>> If hasFeature is to be used, it must be first feature tested.
>
> As will any alternate API for detecting implementation.
>
>
>>That feature [hasFeature()] cannot be reliably used for the web.
>
> The fact that it isn't reliable today isn't proof that it is a bad API
Nope. Old and historically unreliable feature. Nobody uses it because
it doe3sn't work.

> (hence, Doug's "reductio ad absurdum" comment).
>

Why doesn't hasFeature work? Well you see, that's that problem right
there. It's the way its designed.

> Incorrect reporting by hasFeature() by an implementation is simply a bug on
> the implementation's part.

And hasFeature will continue to suffer the same bugs as can be
expected. document.implementation is a unrleated interface.

An expectation that all implementations hasFeature updated for
features that function properly will result in the type of
disappointment that has led to the failings of hasFeature.

The inferences that a program makes about the environment should, at
best, be made as closely to the feature that is being used. One who is
less experience in the failings of unrelated inference might
optimistically chock it up to bad browsers.

The first problem is that the feature is unrelated to the
implementation code. The second problem is that the APIs the w3c makes
are so featureful that they do not provide enough granularity.

The optimistic D3E author addresses granularity but does not address
the unrelated inference problem.

>
> Unfortunately, any alternative to hasFeature will likely suffer from
> implementation bugs or incomplete implementation like the examples you gave.

The unrelated inference problem can't be fixed; it is a core design of
the feature testing being on an `implementation` object of a
`document`.

> Unless you have a counter proposal,

Sure I do: eventTarget.generatesEvent(type). I followed up to most
threads, but could not follow up on all fo those threads because I was
banned for what was called a "two weeks" ban after offensive remarks
about an esteemed W3C financier.

I believe the only solution which will
> be reliable on the web *today* is to create and dispatch a test event
> yourself.
>
How does that work? Post up some examples. Thanks.
-- 
Garrett
Received on Tuesday, 28 December 2010 07:31:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:07 GMT