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

Lazy image loading + CSS transform #7235

Open
rwlbuis opened this issue Oct 18, 2021 · 3 comments
Open

Lazy image loading + CSS transform #7235

rwlbuis opened this issue Oct 18, 2021 · 3 comments

Comments

@rwlbuis
Copy link

rwlbuis commented Oct 18, 2021

I noticed implementations behave differently on Intersection Observer combined with CSS transform:
https://jsfiddle.net/38v2dots/2/

In Firefox the callback is triggered as soon as 1 pixel of the image is visible in the viewport. In Chrome the callback is triggered once the complete CSS transform is finished.

I personally like Firefox behaviour more here. Is there anything in the spec(s) about this? I also wonder what the rules are for CSS animations instead of transforms?

@rwlbuis
Copy link
Author

rwlbuis commented Oct 18, 2021

BTW this is basically w3c/IntersectionObserver#484, but since lazy image loading is often/always implemented using intersection observer, the lines are blurred...

@annevk
Copy link
Member

annevk commented Oct 18, 2021

The standard uses Intersection Observer as its underlying primitive. We could keep this open to track that issue from our side and ensure that once it is resolved image loading also takes the resolution into account I suppose.

@rwlbuis
Copy link
Author

rwlbuis commented Oct 18, 2021

The standard uses Intersection Observer as its underlying primitive. We could keep this open to track that issue from our side and ensure that once it is resolved image loading also takes the resolution into account I suppose.

Yes, to be clear, I opened this mainly because it would have bigger audience than just the Intersection Observer spec.

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

No branches or pull requests

2 participants