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 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:43:17 GMT