jquery / jquery

jQuery JavaScript Library
https://jquery.com
MIT License
58.93k stars 20.62k forks source link

jQuery 3.7.1 is still making wrong calculation of dimensions in Firefox. #5456

Closed cyfung1031 closed 1 month ago

cyfung1031 commented 1 month ago

This is still not making sense in 3.7.1

https://jsfiddle.net/lunarlogic489/6qc5bmL3/

<div>
  <table style="width:600px;">
    <tbody>
    <tr>
      <td style="white-space:normal;width:120px;">INGRESOS DE ACTIVIDADES ORDINARIAS</td>
      <td style="white-space:normal;width:79px;">VENTA DE BIENES</td>
      <td id="td" style="width:235px;"></td>
      <td></td>
    </tr>
    </tbody>
  </table>
</div>
$('tr').height()
$('tbody').height()
Screen Shot 2024-03-25 at 20 18 13

Why tr height can be larger than tbody height? (Firefox)

Same as 4.0.0 beta

Related to #5270

timmywil commented 1 month ago

Thanks for opening an issue. The difference is expected. The browser you are using is not passing the reliableTrDimensions support test, so jQuery must use a different way to determine the dimensions, which unfortunately does not return fractional values.

And #5270 is not related because removing bootstrap gives the same results, but the difference was noted in a comment on that issue.