W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2008

Re: [selectors-api] What DOM feature "Selectors API" belongs to?

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Mon, 14 Jul 2008 03:40:44 +0200
Message-ID: <487AAE9C.1040105@lachy.id.au>
To: Kartikaya Gupta <lists.webapps@stakface.com>
Cc: public-webapps <public-webapps@w3.org>

Kartikaya Gupta wrote:
> On Thu, 10 Jul 2008 08:10:09 +0200, Lachlan Hunt
> <lachlan.hunt@lachy.id.au> wrote:
>> Do you use hasFeature() to detect the presence of any other DOM
>> APIs? If so, when and why?
> We use feature strings to detect whether or not the DOM 
> implementation supports creating/dispatching certain types of 
> (custom) events. This allows a decoupling of code that uses the DOM 
> with the DOM implementation itself, and allows for independently 
> upgradable components. Some parts of the code also require additional 
> DOM functionality beyond what is provided by the standard APIs. This 
> is exposed via additional interfaces on various DOM objects and 
> feature strings are used to ensure that the DOM provides 
> implementations of these interfaces. Again, this is largely to 
> achieve modularity; it allows the "external" code to be maintained 
> separately rather than tying it to our specific DOM implementation. 
> Hypothetically speaking, if we were to implement something like Gears 
> in Java, it would also be using feature strings extensively to detect 
> the presence or absence of various features.

Would it be acceptable if I defined one, but made it optional for 
implementers to support?  Or at least optional for ECMAScript 
implementations?  That way an implementation can choose to support it if 
feature detection is necessary for the language and there is no other 
way to do it.

Lachlan Hunt - Opera Software
Received on Monday, 14 July 2008 01:41:26 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:11 UTC