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

Avoid firing 'load' or 'error' events for <img> when the loaded image didn't change #8492

Open
zcorpan opened this issue Nov 10, 2022 · 0 comments

Comments

@zcorpan
Copy link
Member

zcorpan commented Nov 10, 2022

Currently, in the "update the image data" algorithm for img, if the loaded image is the same as the previous image, it will still fire a load event. Similarly for error (see #4480).

Investigate if it's compatible to change this to avoid firing load or error when there was no change (other than updating the current pixel density).

See discussion in #8008

@zcorpan

If this change appears too risky, I think we could first try to change the “load the image data” algorithm to avoid firing “load” and “error” events in more cases. If that is compatible, then it should alleviate the main compat risk for auto-sizes.

@yoavweiss

At the same time, I kinda like the option of avoiding firing the "load"/"error" events in cases where the image didn't actually loaded.

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

No branches or pull requests

1 participant