[go: nahoru, domu]

Skip to content
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

Merged
merged 9 commits into from
Dec 20, 2019

Conversation

jazyan
Copy link
Collaborator
@jazyan jazyan commented Dec 16, 2019

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

@jazyan jazyan changed the title core(offscreen-images): pass offscreen images with a specified 'loading' attribute core(offscreen-images): pass offscreen images with 'loading' attribute Dec 16, 2019
Copy link
Collaborator
@connorjclark connorjclark left a 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! 🎉

Copy link
Collaborator
@patrickhulce patrickhulce left a 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!

Copy link
Member
@exterkamp exterkamp left a 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 => {
Copy link
Collaborator

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 🤷‍♂️

@jazyan
Copy link
Collaborator Author
jazyan commented Dec 20, 2019

Thanks for the reviews! Merging is blocked for me, so if all looks good, would appreciate if an authorized user can merge this 😅

@connorjclark connorjclark changed the title core(offscreen-images): pass offscreen images with 'loading' attribute core(offscreen-images): pass images with 'loading' attribute Dec 20, 2019
@connorjclark connorjclark merged commit abee0c0 into master Dec 20, 2019
@connorjclark connorjclark deleted the issue10053 branch December 20, 2019 19:27
@connorjclark
Copy link
Collaborator

🎉

@patrickhulce
Copy link
Collaborator

woohoo, great contribution @jazyan! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'Defer offscreen images' doesn't consider 'loading=lazy' attribute
5 participants