getBoundingClientRect returns animated boxes; use offset geometry for layout
@jefft72▲ 7 net votes
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.