HtmlUnit supports finding elements via CSS selectors, for instance, class name selectors. However, there is a special case where the lookup fails currently. See the following example:
<div class="foo bar baz">
Querying with the CSS selector ".bar" is supposed to return the div element.
This works only if the "bar" class name in the HTML example above is enclosed by regular spaces, but won't work if other whitespace characters, such as tabs or newlines, are used to separate the class names from each other.
Please see the test case which also demonstrates the behavior of Firefox and Chrome in this case.
Fixed in SVN. Thanks for reporting.