Making selectors first-class citizens

As far as I can tell Element.prototype.matches() is not deployed yet.
Should we instead make selectors first-class citizens, just like
regular expressions, and have this:

  var sel = new Selectors("i > love > selectors, so[much]")
  sel.test(node)

That seems like a much nicer approach.

(It also means this can be neatly defined in the Selectors
specification, rather than in DOM, which means less work for me. :-))


-- 
http://annevankesteren.nl/

Received on Wednesday, 11 September 2013 13:34:09 UTC