[IntersectionObserver] Fix tracked element bookkeeping
This patch caused a leak in IntersectionObserverController: https://chromium-review.googlesource.com/c/chromium/src/+/1774244 In particular, if an explicit-root IntersectionObserver was destroyed because it had no observations and no javascript references to it, then IntersectionObserverController would continue to track the root Element. This patch overhauls the way the tracking bookkeeping is handled for explicit-root observers, and guarantees two important cases: - If the observer dies, the root will no longer be tracked. - If the root element dies, any remaining observations will be disconnected. Change-Id: Ieb3822a4735850c7baae4ef32e7826f3eda10fb7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2008528 Commit-Queue: Stefan Zager <szager@chromium.org> Reviewed-by:Kentaro Hara <haraken@chromium.org> Reviewed-by:
vmpstr <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/master@{#734206}
Showing
Please register or sign in to comment