If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

JS doesn't give correct table cell heights when line-height is non integer

VERIFIED DUPLICATE of bug 825607

Status

()

Firefox
Untriaged
VERIFIED DUPLICATE of bug 825607
5 years ago
5 years ago

People

(Reporter: Adrian Osmond, Unassigned)

Tracking

18 Branch
x86
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11

Steps to reproduce:

See http://jsfiddle.net/adrianosmond/y9vMQ/3/

Created a table with line-height not set to an integer value (22.5px). Cloned that table, and set the heights of the rows in the cloned table manually to the heights that JavaScript tells me that the rows in the first table are.


Actual results:

The cloned table row heights come back at 23px rather than 22.5px, so the cloned table is a different size to the original


Expected results:

The values should've come back as 22.5px
Status: UNCONFIRMED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 825607
Yep.  The offset* APIs are just broken and unfortunately can't be fixed.  Use getBoundingClientRect.
Status: RESOLVED → VERIFIED
I added a note to following pages because I saw many similar bugs.
https://developer.mozilla.org/en-US/docs/DOM/element.clientWidth
https://developer.mozilla.org/en-US/docs/DOM/element.clientHeight
https://developer.mozilla.org/en-US/docs/DOM/element.offsetWidth
https://developer.mozilla.org/en-US/docs/DOM/element.offsetHeight
https://developer.mozilla.org/en-US/docs/DOM/element.scrollWidth
https://developer.mozilla.org/en-US/docs/DOM/element.scrollHeight
You need to log in before you can comment on or make changes to this bug.