Closed
Bug 828187
Opened 12 years ago
Closed 12 years ago
JS doesn't give correct table cell heights when line-height is non integer
Categories
(Firefox :: Untriaged, defect)
Tracking
()
VERIFIED
DUPLICATE
of bug 825607
People
(Reporter: a.c.osmond, Unassigned)
Details
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
Updated•12 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
![]() |
||
Comment 2•12 years ago
|
||
Yep. The offset* APIs are just broken and unfortunately can't be fixed. Use getBoundingClientRect.
Status: RESOLVED → VERIFIED
Comment 3•12 years ago
|
||
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.
Description
•