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(image-elements): drop spritesheet logic #8940

Merged
merged 4 commits into from
May 23, 2019

Conversation

patrickhulce
Copy link
Collaborator

Summary
We previously had some broken logic to address spritesheets in CSS for our responsive images but it has several flaws. I think we should just drop it and ignore CSS background images in our responsive image audit.

Here's why:

  1. It didn't work (Properly Size Images 54 KB to 53 KB #8927). This one is obviously fixable but I don't think we should for the other reasons below :)
  2. Doing responsive images in CSS is far more difficult and typically less impactful than responsive images in HTML. i.e. the opportunity to effort ratio is much lower here than other areas we should be wanting to spend time fixing things.
  3. A false negative is better than a false positive.
  4. It fails to account for additional usages of the sprites that might be hidden on interaction (thought to be original cause of Properly Size Images 54 KB to 53 KB #8927).
  5. It interferes with the desired audit-agnostic property of gatherers, and we would need to expose quite a bit of additional CSS computed style data on the artifact to allow the audit to determine this properly.
  6. It fails to account for various background size and repeat scenarios where the sizing is intentional and most beneficial for the user.

Related Issues/PRs
fixes #8927

@vercel vercel bot requested a deployment to staging May 16, 2019 14:37 Abandoned
@brendankenny
Copy link
Member

@paulirish wanted a go at this

@patrickhulce
Copy link
Collaborator Author

To clarify, @paulirish wanted to review this, or he wanted to make a case for keeping the spritesheet logic? :)

@brendankenny
Copy link
Member

My understanding is that he thought there was more insight the debugger protocol could provide, but maybe I'm misremembering. You were in that chat too :)

@patrickhulce
Copy link
Collaborator Author

Oh I thought that was about #8493. This PR doesn't deal with stylesheet content really, just image elements that have background set to image which is problematic even when we have the complete stylesheet content. But maybe I'm mixing up my conversations 😆

Copy link
Member

@paulirish paulirish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I thought that was about #8493.

Yup. I was talking about that one. :)

this LG.

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so is the main thing that's happening is that ImageElements now includes all background-image images (some were filtered out before for appearing to be sprite sheets or whatever) while uses-responsive-images is now going to ignore all images in CSS?

@patrickhulce
Copy link
Collaborator Author

ImageElements now includes all background-image images (some were filtered out before for appearing to be sprite sheets or whatever) while uses-responsive-images is now going to ignore all images in CSS?

Bingo

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

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

Successfully merging this pull request may close these issues.

Properly Size Images 54 KB to 53 KB
4 participants