Firefox seem to not include the border width of absolutely positioned elements in offsetLeft/offsetTop. You can see the behavior on:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head><title></title><script type="text/javascript" src="MochiKit.js"></script></head>
<body style="margin:0; padding:0;">
<div style="position:absolute; top:0px; left:0px; width:20px; border:solid 10px #000;">
<div id="foo" style="width:20px; height:10px; background:blue;"></div>
</div>
<br /><br /><br />
<div id="info"></div>
<script type="text/javascript">
connect(window, 'onload', function() { $('info').innerHTML = getElementPosition('foo').toString(); });
</script>
</body></html>
A simple fix, based on
based on http://dev.rubyonrails.org/ticket/10149, that manually includes the border width:
c.x += parseInt(parent.style.borderTopWidth) || 0;
c.y += parseInt(parent.style.borderLeftWidth) || 0;
seems to help, but I'm not sure if it doesn't break anything else. I'll try to test in other browsers.