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(uses-responsive-images): higher threshold with breakpoints #13853

Merged
merged 11 commits into from
Jun 29, 2022

Conversation

TripleEquals
Copy link
Contributor

Summary

This allows for an increased allowance in the failures of the "uses-responsive-images" audit. Instead of the usual allowed 4096B of waste allowed before the audit fails, this change allows 12288B of waste for images that are either picture elements, or utilize the "srcs" asset. This is to encourage the usage of these attributes.

Feature

The audit "uses-responsive-images" is too restrictive and fails too often. This will allow for greater leniency for developers utilizing multiple sizes.

Related Issues/PRs

#11593

Update to include an allowable waste amount for images that use multiple sources, or are picture elements.
@TripleEquals TripleEquals requested a review from a team as a code owner April 14, 2022 15:08
@TripleEquals TripleEquals requested review from connorjclark and removed request for a team April 14, 2022 15:08
@TripleEquals TripleEquals changed the title Responsive image srcs Report: Loosen responsive image audit Apr 14, 2022
@TripleEquals TripleEquals changed the title Report: Loosen responsive image audit report: responsive image srcs Apr 14, 2022
@TripleEquals TripleEquals changed the title report: responsive image srcs report: responsive image srcs loosening Apr 14, 2022
@TripleEquals TripleEquals changed the title report: responsive image srcs loosening report: loosening of responsive-image-srcs Apr 14, 2022
@connorjclark
Copy link
Collaborator

LGTM, but can you add tests in lighthouse-core/test/audits/byte-efficiency/uses-responsive-images-test.js ?

@TripleEquals
Copy link
Contributor Author

Added a couple test cases that should exercise the picture & srcset conditions.

@connorjclark connorjclark changed the title report: loosening of responsive-image-srcs core(uses-responsive-images): use lower threshold if breakpoints used Apr 27, 2022
@connorjclark connorjclark changed the title core(uses-responsive-images): use lower threshold if breakpoints used core(uses-responsive-images): use higher threshold if breakpoints used Apr 27, 2022
@connorjclark
Copy link
Collaborator

Should be good once you update master back.

@connorjclark connorjclark changed the title core(uses-responsive-images): use higher threshold if breakpoints used core(uses-responsive-images): higher threshold with breakpoints Jun 29, 2022
@connorjclark connorjclark merged commit 80295f2 into GoogleChrome:master Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants