jQuery informa a altura do elemento incorreto no iframe do Firefox
Aqui um pequeno teste para demonstrar meu problema. Eu tenho uma página que carrega um iframe:
<html>
<head>
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script>
</head>
<body>
<iframe id="iframe" src="box.html" style="width: 100px; height: 100px"></iframe>
<script>
$('#iframe').bind('load', function () {
var div = $(this).contents().find('div');
alert(div.height());
alert(div.innerHeight());
alert(div.outerHeight());
alert(div.outerHeight(true));
});
</script>
</body>
</html>
O iframe (box.html) contém um único estilo div:
<html>
<head>
<title></title>
<style>
div {
height: 50px;
width: 50px;
margin: 5px;
padding: 5px;
border: 2px solid #00f;
background-color: #f00;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
Os quatro alertas devem retornar 50, 60, 64 e 74, respectivamente. Isso funciona como esperado no Safari e no Chrome. No FF 3.5.1, todos retornam 64. Isso está errado.
Alguém sabe como eu posso forçar o FF / jQuery a retornar os valores corretos?