Bug 264864 - Use scrollMargin for lazy load intersection observer
Summary: Use scrollMargin for lazy load intersection observer
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P3 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-11-14 22:43 PST by Traian Captan
Modified: 2024-06-12 02:09 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Traian Captan 2023-11-14 22:43:53 PST
Currently the lazy load intersection observer is set up using a rootMargin. This does not work well for pages that use images in CSS scrollers, like carousels, causing the images to load too late, when they become visible and the intersection with the root is detected. To work around this issue some developers are choosing to not use lazy loading, thus increasing the overall bandwidth usage for their sites.
This problem was discussed in issue 431(https://github.com/w3c/IntersectionObserver/issues/431).

Using scrollMargin for the lazy load intersection observer will allow lazy loading images to load when they are near the viewport as expected.
Comment 1 Radar WebKit Bug Importer 2023-11-21 22:44:14 PST
<rdar://problem/118706766>