iOS Safari window.scrollTo / getBoundingClientRect bug

from blog Muffin Man, | ↗ original
This is a weird one, and not something you will stumble into every day. But it is a bug nonetheless. On iOS safari, if you use window.scrollTo(0, y) and y is larger than document's maximum scroll, any immediate call to getBoundingClientRect will return incorrect top value. (Same will happen for horizontal scroll and left value.) What happens is...