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

Resource scheduling with IntersectionObserver #25428

Closed
dreamofabear opened this issue Nov 5, 2019 · 2 comments · Fixed by #29733
Closed

Resource scheduling with IntersectionObserver #25428

dreamofabear opened this issue Nov 5, 2019 · 2 comments · Fixed by #29733

Comments

@dreamofabear
Copy link

Investigate replacing AMP's scroll-event-based resource scheduling system with IntersectionObserver.

Related: w3c/IntersectionObserver#372

New flagged feature in Chromium that enables rootMargin on implicit root in x-origin iframes: w3c/IntersectionObserver#372 (comment)

@dreamofabear
Copy link
Author

Dima's suggestions on the "position" vs. "size" coupling issue:

InOb would legitimately skip most of resize events if they do not change intersection. I think this issue comes up here because we've been using measure(), requestMeasure(), mutateElement() and the rest of our infra to do all three: resize, position, and in-viewport monitoring. Separating them at this point would be difficult.

Alternative approach could be do something like this:

  1. Separate layoutBox into position and size.
  2. Remove calls to getLayoutBox() API and instead use an asynchronous API of some kind to either provide measurements or intersection.
  3. Remove measureCallback() APIs and replace them with async versions, that are cleaner map to resize observer concept.
  4. Remove inViewport() callback and replace with async API better mapped to InOb.

@samouri
Copy link
Member

samouri commented Aug 7, 2020

🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉
🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉
🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉
🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉
🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉
🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉
🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉
🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉
🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉
🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉

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

Successfully merging a pull request may close this issue.

2 participants