Skip to content

Commit

Permalink
core(uses-responsive-images-snapshot): ignore CSS images (#14890)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamraine authored Mar 21, 2023
1 parent db62a55 commit 947366d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ class UsesResponsiveImagesSnapshot extends Audit {
/** @type {LH.Audit.Details.TableItem[]} */
const items = [];
for (const image of artifacts.ImageElements) {
// Ignore CSS images because it's difficult to determine what is a spritesheet,
// and the reward-to-effort ratio for responsive CSS images is quite low https://css-tricks.com/responsive-images-css/.
if (image.isCss) continue;

if (!image.naturalDimensions) continue;
const actual = image.naturalDimensions;
const displayed = UsesResponsiveImages.default.getDisplayedDimensions(
Expand Down

0 comments on commit 947366d

Please sign in to comment.