When I access Firefox version 17.0.1 and request
document.body.getBoundingClientRect().top;
on a simple site with no CSS styling applied, it returns an incorrect value. Instead of the expected 8
, which is the default for the browser, it shows 21.4
. However, the .left
offset is accurate.
In contrast, Chrome displays the correct offset values, giving me 8
for both top and left.
I have included a screenshot to illustrate why the top value should not be 22.4
.
Below is the HTML code:
<html><head>
<title>Index</title>
<style type="text/css"></style></head>
<body>
<div>
<h1>Index</h1>
<p>This is the index. The site contains in total 4 sites without
any Javascript. They are linked using href links.</p>
<p>The site looks like this:</p>
<ul>
<li>Index ->; a</li>
<li>Index ->; b</li>
<li>b ->; c</li>
<li>c ->; b</li>
<li>c ->; Index</li>
</ul>
</div>
<a href="a.html">Go to A</a>
<a href="b.html">Go to B</a>
</body></html>