HtmlUnit did not return the correct clientHeight; but did return some non-zero of clientWidth:
<html>
<head>
<script language="javascript">
function test() {
alert(document.body.clientHeight);
alert(document.body.clientWidth);
}
</script> </head>
<body onload="javascript:test()">
</html>
What value did you get for clientHeight? There's really no "wrong" value here (except maybe 0). I'm getting 20 right now, using the code in SVN.
With HtmlUnit r5159. I got these:
0 // clientHeight
1256 // clientWidth
Firefox would return the correct sizes of the Firefox window.
Right, but what I'm saying is that there is no HtmlUnit window to get the size of; in fact, if you make the Firefox window as small as possible and load your example HTML page, it's possible to get Firefox to alert 0 as the clientHeight.
How does a hardcoded value of 600 for the "window" size sound?
Any non-zero value will be passed in our tests. I am fine with 600.
Fixed in SVN; HU's stardard "window" height is now 605 pixels.