Uses a passive scroll listener with requestAnimationFrame instead of assigning window.onscroll, which also no longer clobbers or gets clobbered by other window.onscroll handlers.