Closed Bug 1239467 Opened 8 years ago Closed 4 years ago

Element.clientHeight is not the same measurement as element.getBoundingClientRect()

Categories

(Developer Documentation Graveyard :: API: CSSOM, defect, P5)

All
Other
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: michaelg, Unassigned)

References

()

Details

:: Developer Documentation Request

      Request Type: Correction
     Gecko Version: unspecified
 Technical Contact: 

:: Details

The clientHeight documentation specifies: "Note: This property will round the value to an integer. If you need a fractional value, use element.getBoundingClientRect()."

However, element.getBoundingClientRect().height actually corresponds with element.offsetHeight, not element.clientHeight. element.clientHeight does not include the border or scrollbar height, while element.getBoundingClientRect() does include those in its dimensions.

The offsetHeight documentation has the same note, and it is correct for offsetHeight, just not for clientHeight.
MDN Web Docs' bug reporting has now moved to GitHub. From now on, please file content bugs at https://github.com/mdn/sprints/issues/ and platform bugs at https://github.com/mdn/kuma/issues/.
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.