Contact emails
scli...@chromium.org, be...@chromium.org, rajen...@chromium.org
Explainer
https://github.com/scott-little/lazyload
https://docs.google.com/document/d/1e8ZbVyUwgIkQMvJma3kKUDg8UUkLRRdANStqKuOIvHg/edit
Spec
Spec change pull request: https://github.com/whatwg/html/pull/3752
Tag review: https://github.com/w3ctag/design-reviews/issues/361 (started recently, since we initially didn't think one was necessary, but better late than never).
Summary
Support deferring the load of below-the-fold images and iframes on the page until the user scrolls near them. This is to reduce data usage, memory usage, and speed up above-the-fold content. Web pages can use the "loading" attribute on <img> and <iframe> elements to control and interact with the default lazy loading behavior, with possible values "lazy", "eager", and "auto" (which is equivalent to leaving the "loading" attribute unset).
Deferred content will start loading in when the user scrolls the viewport within a particular distance of it. The load-in distance depends on factors like the speed of the network, tuned such that content is typically finished loading in by the time it becomes visible.
Link to “Intent to Implement” blink-dev discussion
https://groups.google.com/a/chromium.org/d/msg/blink-dev/czmmZUd4Vww/1-H6j-zdAwAJ
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes, all platforms will support lazily loading <img> and <iframe> elements with loading="lazy" set on them.
On Android Chrome with Data saver turned on, elements with loading="auto" or unset will also be lazily loaded if Chrome determines them to be good candidates for lazy loading (according to heuristics). Setting loading="eager" on the image or iframe element will still prevent it from being lazily loaded though.
Risks
Interoperability and Compatibility
Firefox: No public signals
Edge: No public signals
Safari: Some public support
A WebKit developer has mentioned that Apple is interested in this kind of feature and is a reviewer on the LazyLoad spec pull request.
Web developers: Positive signals
A thread on WICG about lazy loading images
Elements deferred by LazyLoad will have their onload event delayed until they load in later on (e.g. after the user scrolls nearby), which could happen after the document's onload event fires.
Ads that count impressions when an ad is loaded instead of when the ad is seen by the user (i.e. becomes visible in the viewport) could see their impression counts change for ads are currently often loaded but not seen. Users will still see lazily loaded ads just as often as they would have otherwise though.
Other compatibility risks are listed in the design doc.
Ergonomics
Deferring images makes use of the image replacement feature in Blink in order to avoid reflows when images load in later.
Some browser features (e.g. Print, Save Page As) that expect all resources to be fully loaded will currently show any deferred images or frames as blank boxes if they haven't loaded in yet, but this is something that will be fixed after the initial shipping (e.g. by forcing all deferred content to load in immediately, and block the print/save operation on that). More details here.
Activation
Sites can use LazyLoad by setting the attribute loading="lazy" on images or iframes. Sites can also prevent image or iframe elements from being lazily loaded by setting loading="eager" on them. Sites can detect LazyLoad support in JavaScript by checking if the "loading" property is defined, in a similar way to how many other features can be detected, e.g.:
if ('loading' in HTMLImageElement.prototype) { … }
We're also exploring adding a Client Hint for LazyLoad support.
Debuggability
When images are being lazily loaded, a message is logged to the console. No other DevTools integration is currently planned.
Demo
At time of writing, LazyLoad can be experimented with by going to chrome://flags and turning on both "Enable lazy frame loading" and "Enable lazy image loading". This will turn on LazyLoad for images and iframes marked loading="lazy", plus those marked loading="auto" or without any "loading" attribute set that are well suited to being lazily loaded, similar to how the feature will behave for Android Chrome Data Saver users when launched.
Is this feature fully tested by web-platform-tests?
The tests are in progress right now, but it will be fully tested by web-platform-tests.
Tracking bug
https://bugs.chromium.org/p/chromium/issues/detail?id=709494
Entry on the feature dashboard
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/e70588ac-6395-42f2-94f0-40daafff8ec8%40chromium.org.
Contact emails
scli...@chromium.org, be...@chromium.org, rajen...@chromium.org
Explainer
https://github.com/scott-little/lazyload
https://docs.google.com/document/d/1e8ZbVyUwgIkQMvJma3kKUDg8UUkLRRdANStqKuOIvHg/edit
Spec
Spec change pull request: https://github.com/whatwg/html/pull/3752
Tag review: https://github.com/w3ctag/design-reviews/issues/361 (started recently, since we initially didn't think one was necessary, but better late than never).
Summary
Support deferring the load of below-the-fold images and iframes on the page until the user scrolls near them. This is to reduce data usage, memory usage, and speed up above-the-fold content. Web pages can use the "loading" attribute on <img> and <iframe> elements to control and interact with the default lazy loading behavior, with possible values "lazy", "eager", and "auto" (which is equivalent to leaving the "loading" attribute unset).
Deferred content will start loading in when the user scrolls the viewport within a particular distance of it. The load-in distance depends on factors like the speed of the network, tuned such that content is typically finished loading in by the time it becomes visible.
Link to “Intent to Implement” blink-dev discussion
https://groups.google.com/a/chromium.org/d/msg/blink-dev/czmmZUd4Vww/1-H6j-zdAwAJ
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes, all platforms will support lazily loading <img> and <iframe> elements with loading="lazy" set on them.
On Android Chrome with Data saver turned on, elements with loading="auto" or unset will also be lazily loaded if Chrome determines them to be good candidates for lazy loading (according to heuristics). Setting loading="eager" on the image or iframe element will still prevent it from being lazily loaded though.
Risks
Interoperability and Compatibility
Firefox: No public signals
Edge: No public signals
Safari: Some public support
A WebKit developer has mentioned that Apple is interested in this kind of feature and is a reviewer on the LazyLoad spec pull request.
Web developers: Positive signals
A thread on WICG about lazy loading images
Elements deferred by LazyLoad will have their onload event delayed until they load in later on (e.g. after the user scrolls nearby), which could happen after the document's onload event fires.
Ads that count impressions when an ad is loaded instead of when the ad is seen by the user (i.e. becomes visible in the viewport) could see their impression counts change for ads are currently often loaded but not seen. Users will still see lazily loaded ads just as often as they would have otherwise though.
Other compatibility risks are listed in the design doc.
Ergonomics
Deferring images makes use of the image replacement feature in Blink in order to avoid reflows when images load in later.
Some browser features (e.g. Print, Save Page As) that expect all resources to be fully loaded will currently show any deferred images or frames as blank boxes if they haven't loaded in yet, but this is something that will be fixed after the initial shipping (e.g. by forcing all deferred content to load in immediately, and block the print/save operation on that). More details here.
Activation
Sites can use LazyLoad by setting the attribute loading="lazy" on images or iframes. Sites can also prevent image or iframe elements from being lazily loaded by setting loading="eager" on them. Sites can detect LazyLoad support in JavaScript by checking if the "loading" property is defined, in a similar way to how many other features can be detected, e.g.:
if ('loading' in HTMLImageElement.prototype) { … }
Debuggability
When images are being lazily loaded, a message is logged to the console. No other DevTools integration is currently planned.
Demo
At time of writing, LazyLoad can be experimented with by going to chrome://flags and turning on both "Enable lazy frame loading" and "Enable lazy image loading". This will turn on LazyLoad for images and iframes marked loading="lazy", plus those marked loading="auto" or without any "loading" attribute set that are well suited to being lazily loaded, similar to how the feature will behave for Android Chrome Data Saver users when launched.
Is this feature fully tested by web-platform-tests?
The tests are in progress right now, but it will be fully tested by web-platform-tests.
Tracking bug
https://bugs.chromium.org/p/chromium/issues/detail?id=709494
Entry on the feature dashboard
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACBp5rV_uNeekijVoSezJXc5nf4RKTmHk4ZMe6tvosy9amtQQQ%40mail.gmail.com.
Non-owner LGTM. Very very excited to see this work finally shipping! Scott, did we resolve if the implementation we're shipping..
(1) Has <picture> support wired up? We had discussed this with Yoav but unsure of current status.
(2) Whether developers are likely to see double fetch entries in the DevTools network panel? I recall we fetch the first 2KB of images on page load & the remaining bytes when they're about to see the image.
For (2) I guess we can also wait and see how the discussion in https://github.com/w3c/resource-timing/issues/205 evolves.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/e70588ac-6395-42f2-94f0-40daafff8ec8%40chromium.org.
I share the general excitement, and think this feature is long overdue on the web. Thanks for working on this! :)
On Sat, Apr 6, 2019 at 12:40 AM Scott Little <scli...@chromium.org> wrote:
Contact emails
To unsubscribe from this group and stop receiving emails from it, send an email to blin...@chromium.org.
I have just tested this new lazy load experimental feature in Chrome (73.0.3683.103).I found an issue with the loading of css background images.Example: https://take.ms/fUtNJThe lazy loading breaks the page navigation / dropdown menu, as certain background images are suppressed: https://take.ms/GQzX4
Is there a way to pass the loading attribute "eager" also to css background images?
Support deferring the load of below-the-fold images and iframes on the page until the user scrolls near them. This is to reduce data usage, memory usage, and speed up above-the-fold content. Web pages can use the "loading" attribute on <img> and <iframe> elements to control and interact with the default lazy loading behavior, with possible values "lazy", "eager", and "auto" (which is equivalent to leaving the "loading" attribute unset)
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/12fa06d1-9e20-4e3f-9be9-3b4d9971bda0%40chromium.org.
const img = new Image(); img.src = url; img.onload = () => { // ready! };
const img = new Image(); img.src = url; await img.decode(); // ready!
const div = document.createElement('div'); div.style.display = 'none'; document.body.append(div); const img = new Image(); img.src = url; div.append(img); img.onload = () => { div.style.display = 'block'; };
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/e356d343-8d56-4b2b-a83f-045dced55598%40chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blin...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/e356d343-8d56-4b2b-a83f-045dced55598%40chromium.org.