Bug 230998
Summary: | Allow IntersectionObserver API to specify root for individual targets | ||
---|---|---|---|
Product: | WebKit | Reporter: | Nikos Mouchtaris <nmouchtaris> |
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | jonlee, rbuis, simon.fraser, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=208094 |
Nikos Mouchtaris
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Nikos Mouchtaris
rdar://83693358
Nikos Mouchtaris
https://github.com/w3c/IntersectionObserver/issues/431
Nikos Mouchtaris
See that for image in scrollable div only gets loaded once it enters the viewport: https://codepen.io/nmoucht/pen/VwWgoPv.