-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core(offscreen-images): pass images with 'loading' attribute #10117
Conversation
lighthouse-core/test/audits/byte-efficiency/offscreen-images-test.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yay for new web platform features! 🎉
lighthouse-core/test/audits/byte-efficiency/offscreen-images-test.js
Outdated
Show resolved
Hide resolved
lighthouse-core/test/audits/byte-efficiency/offscreen-images-test.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is looking great @jazyan thanks so much for helping out with this!
lighthouse-core/test/audits/byte-efficiency/offscreen-images-test.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! 🎉
Only nit is for more testing 🔍
devtoolsLogs: {}, | ||
}; | ||
|
||
return UnusedImages.audit_(artifacts, networkRecords, context).then(auditResult => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bit iffy on the .then
in an async
function, but all these other tests do the same so 🤷♂️
Thanks for the reviews! Merging is blocked for me, so if all looks good, would appreciate if an authorized user can merge this 😅 |
🎉 |
woohoo, great contribution @jazyan! 🎉 |
Summary
Native lazy-loading was recently introduced in Chrome 76. This PR excludes images with a specified 'loading' attribute ('lazy' and 'eager', 'auto' TBD) from the 'defer offscreen images' check.
See https://web.dev/native-lazy-loading/ for more details about the loading attribute.
Related Issues/PRs
fixes: #10053