- From: Sean Hogan <shogun70@westnet.com.au>
- Date: Fri, 25 Sep 2009 20:42:06 +1000
- To: Lachlan Hunt <lachlan.hunt@lachy.id.au>
- CC: public-webapps <public-webapps@w3.org>
Sean Hogan wrote: > Hi Lachy, > > Here's a proposal. > > querySelector*(selector, context) // allows selectors with :scope > pseudo-class > queryScopedSelector*(selector, context) // allows selectors with > implied :scope > matchesSelector(selector, context) // allows selectors with :scope > pseudo-class > > To check if the :scope pseudo-class is available, use: > > try { document.body.matchesSelector(":scope", document.body); } > catch (error) { /* not supported */ } > > OR > > try { document.querySelector(":scope", document.body); } > catch (error) { /* not supported */ } > Sorry. Replace document.body with document.documentElement. That should be more efficient for the querySelector test.
Received on Friday, 25 September 2009 10:42:47 UTC