IntersectionObserver API should allow the specification of multiple roots, depending on the target element. This is needed for lazy image loading, as for lazy load images in scrollable elements, we want to set their root to the scrollable element, not the viewport. The current implementation results in the images being loaded only once they partially enter the viewport, as their root is set to the top-level viewport, not the scrollable element.
rdar://83693358
https://github.com/w3c/IntersectionObserver/issues/431
See that for image in scrollable div only gets loaded once it enters the viewport: https://codepen.io/nmoucht/pen/VwWgoPv.