Closed
Description
AlphaTab uses a custom scroll listener for "lazy loading" the generated image chunks into the DOM for smoother UI feedback. This is based on the getBoundingClientRect
which is very expensive as it might cause a layout flow in the browser.
The intersection observer API is way more lightweight and provides exactly what we need for lazy loading.
Also this API should be used for detecting the visibility of the element on-load.
https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API