When finding buttons by type attribute via CSS, there is a tiny discrepancy between HtmlUnit and real browsers. For example, when we search for button[type='submit'], HtmlUnit will find not only submit buttons, but also buttons without a type attribute. Maybe this is because the default value for the type attribute is submit. BTW, does not happen when searching via XPath.
Other elements / other attributes may be affected in a similar fashion, but not sure. Tested this with input elements and input[type='text'], but this works as expected.
Thanks!