Menu

#973 HtmlUnit unable to determine clientHeight

closed
None
5
2012-10-21
2009-11-13
Frank Lin
No

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>

Discussion

  • Daniel Gredler

    Daniel Gredler - 2009-11-22

    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.

     
  • Frank Lin

    Frank Lin - 2009-11-23

    With HtmlUnit r5159. I got these:
    0 // clientHeight
    1256 // clientWidth

    Firefox would return the correct sizes of the Firefox window.

     
  • Daniel Gredler

    Daniel Gredler - 2009-11-27

    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?

     
  • Frank Lin

    Frank Lin - 2009-11-30

    Any non-zero value will be passed in our tests. I am fine with 600.

     
  • Daniel Gredler

    Daniel Gredler - 2009-12-13

    Fixed in SVN; HU's stardard "window" height is now 605 pixels.

     

Log in to post a comment.