W3C home > Mailing lists > Public > public-webapi@w3.org > April 2008

Re: [SelectorsAPI] Selector detection needed?

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 07 Apr 2008 12:09:15 -0500
Message-ID: <47FA553B.5040104@mit.edu>
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
CC: "Web APIs WG (public)" <public-webapi@w3.org>, www-style Mailing List <www-style@w3.org>

[moving this to the right mailing list]
Daniel Glazman wrote:
> Oh come on. So to test if the childhood combinator ">" is implemented

Why would you be testing that?  What's the use case?

The way I see this working in practice is something like this:

   var elements;
   try {
     elements = document.querySelectorAll("something");
   } catch (e) {
     // Use a slower implementation of the "something" selector
   }

This is certainly how I expect JS libraries to use querySelectorAll...

In what cases would you want to check whether a selector is parsed but _not_ 
actually try matching against it?

-Boris
Received on Monday, 7 April 2008 17:10:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 April 2008 17:10:06 GMT