w3c / IntersectionObserver

Intersection Observer
https://www.w3.org/TR/intersection-observer/
Other
3.62k stars 531 forks source link

Allow setting `rootMargin` #486

Open zcorpan opened 2 years ago

zcorpan commented 2 years ago

Part of #428.

The following tasks have been completed:

Implementation commitment:


Preview | Diff

szager-chromium commented 2 years ago

What effect, if any, will modifying rootMargin have on previousThresholdIndex for active observations? Perhaps they should all have previousThresholdIndex set to -1, just as it is when observe() is first called:

https://w3c.github.io/IntersectionObserver/#observe-target-element

One side effect would be that modifying rootMargin would cause every observation to generate a notification at the next opportunity.