Yep. The offset* APIs are just broken and unfortunately can't be fixed. Use getBoundingClientRect.
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