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

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

From: Kartikaya Gupta <lists.webapps@stakface.com>
Date: Thu, 10 Jul 2008 14:00:31 +0000
To: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Cc: public-webapps <public-webapps@w3.org>
Message-ID: <E1KGwhk-00048l-NC@bart.w3.org>

On Thu, 10 Jul 2008 08:10:09 +0200, Lachlan Hunt <lachlan.hunt@lachy.id.au> wrote:
> Kartikaya Gupta wrote:
> > Speaking as an implementor in Java, I would like to see a feature 
> > string defined. I can't provide any evidence that people use feature 
> > strings now
> 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.
Received on Thursday, 10 July 2008 14:01:16 UTC

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