jnicklas/capybara — pull request #961 by twalpole (2013-02-16 21:35:00+00:00)
Title: dont convert css to xpath

@jnicklas - Seeing issue #923 get closed this morning (request for :invalid pseudo selector support), it made me revisit something I'd been meaning to look at for a while. Why always convert css to xpath when browsers can handle direct css searches? This PR is the beginning of work on allowing css selectors to just flow through and be searched for as css, which would allow for css pseudo selectors to be used on browsers that support them. Currently this code would require drivers to implement a find_css method which is obviously not optimal. I think a better way may be for find to take a second parameter indicating whether the selector is xpath or css, and a way for the driver to indicate whether it will accept css, but this would break the current driver api. I've also implemented the :disabled and :enabled pseudo selectors in the RackTest driver as proof that some of the css pseudo selectors can be implemented there (obviously not :invalid). Your thoughts on how best to implement this, and whether or not you would consider it are appreciated before I finish it up