http://www.w3.org/TR/selectors-api/ Would be very handy for authors.
Created attachment 18074 [details] In-progress patch There are quite a few issues with this patch, so I'm not requesting review yet. It leaks memory, uses NodeList instead of StaticNodeList, and doesn't implement the functions other than querySelectorAll. Other than that it appears to work nicely, though :)
Created attachment 18079 [details] another in-progress patch (adds StaticNodeList)
Created attachment 18088 [details] more fun
Adding a link to a version of Dean Edward's tests for his cssQuery function modified to tolerate exceptions and use querySelector/querySelectorAll instead of cssQuery. With the latest patch we pass for all selectors WebKit supports.
Created attachment 18095 [details] Stop leaking a bunch of CSS stuff every query
Created attachment 18097 [details] Much much faster Benchmarking + Sharking + Weinig making good suggestions == Speedy
Created attachment 18098 [details] Fixes selectors with commas Previously things like a, b { } would fail, since we weren't checking all the selectors. There are now no test failures on the slickspeed test, except those due to webkit not supporting the relevant selector.
Created attachment 18100 [details] Updated Fixed comma selectors for querySelector as well as querySelectorAll, made a tiny optimization, and added a changelog.
Created attachment 18103 [details] Handle null and undefined according to the spec This also makes it so that if you put in syntactically valid CSS that is not a selector, it throws a syntax error as it should (for example: "@font-face").
Ken Ferry points out that although the CSS spec does define an empty selector as invalid, it's possibly a reasonable interpretation to say that null/undefined are just not selectors at all, valid or invalid. I think we should probably get this clarified. I'm also not convinced that throwing is the best behavior for the spec to dictate in this situation, but that's another matter.
Created attachment 18113 [details] Now with tests :) I think this is ready for review.
Comment on attachment 18113 [details] Now with tests :) With the various formatting fixes i mentioned in irc
Landed in r28981