Currently the CSS selector :focus is not supported, which leads to an error when I try to open one of my pages (Atlassian JIRA).
I already have a testcase for this but here at home I have only IE9 and FF18. So I will test tomorrow in the office where I have IE8 and FF17 and add the testcase to this issue then.
As you have the currently focused element in
com.gargoylesoftware.htmlunit.html.HtmlPage.getFocusedElement()
it should not be a big problem to extend com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet.selectsPseudoClass(BrowserVersion, AttributeCondition, DomElement)
to support :focus.
Here is a test for FF17, IE8 and IE9.
The test is not working while driving FF17 with WebDriver but I think that the test is correct and that it is a bug in the FirefoxDriver.
fixed in SVN, thanks for reporting