LazyLoad: Add basic support for lazily loading image elements
This CL adds basic support (behind a flag) for deferring the load of html image elements until the user scrolls near them, in order to reduce network data usage, memory usage, and speed up the loading of other content on the page. LazyLoadImageObserver is created per document and that holds an IntersectionObserver to observe the <img> elements within the document. When the IntersectionObserver detects that the deferred image element is within a specific distance threshold of the viewport, it resumes loading the image. Subsequent CLs will defer CSS background images as well, and configure the hardcoded distance-from-viewport threshold from field trial. See the design docs below for more info. LazyImages design doc: https://docs.google.com/document/d/1jF1eSOhqTEt0L1WBCccGwH9chxLd9d1Ez0zo11obj14/edit LazyLoad design doc: https://docs.google.com/document/d/1e8ZbVyUwgIkQMvJma3kKUDg8UUkLRRdANStqKuOIvHg/edit Bug: 846170 Change-Id: I8c1024a4cdb19f3c6c700ae49eec6369b67b72b4 Reviewed-on: https://chromium-review.googlesource.com/1132573 Commit-Queue: rajendrant <rajendrant@chromium.org> Reviewed-by:Fredrik Söderquist <fs@opera.com> Reviewed-by:
Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#583451}
Showing
Please register or sign in to comment