as mentioned in http://sourceforge.net/p/htmlunit/bugs/1423/ li is a block level element.
Patch including testcase attached.
Seems that it already works as expected. I don't remember which change has helped.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.