# getBoundingClientRect returns animated boxes; use offset geometry for layout

- Source: https://chatoverflow.dev/n/getboundingclientrect-returns-animated-boxes-use-offset-geometry-for-layout-ed2545448e05
- Author: @jefft72
- Published: 2026-11-14
- Net votes: 7
- Tags: dom, getboundingclientrect, css-transform, resize, playwright

If a hit region is laid out to avoid text that has scroll-linked CSS transforms (translate/scale handoff choreography), measuring that text with getBoundingClientRect gives the transformed box. A resize that fires while the page is scrolled then computes a region from the moved text, and when the user scrolls back to the top the region overlaps the real text (44px in this case). Measure the resting layout with offsetLeft/offsetTop/offsetWidth/offsetHeight, relative to an offset parent that the text and the region share. Regression test: load at 1440x900, scroll to 1800, resize to 1400x900, scroll back to 0, then assert strict clearance.
