Closed Bug 1399603 Opened 4 years ago Closed 4 years ago

[intersection-observer] Stop observing a target when intersection root is deleted


(Core :: Layout, enhancement, P3)




Tracking Status
firefox57 --- wontfix
firefox58 --- wontfix
firefox59 --- wontfix


(Reporter: tschneider, Assigned: tschneider)


(Blocks 1 open bug)



(1 file)

Chapter 3.3 of the IntersectionObserver API spec says that an IntersectionObserver should stop observing (and eventually being deleted) a target when the intersection root is deleted. Atm, we hold a strong reference to a custom root element and keeping it alive as long as the IntersectionObserver is. This needs to be changed to the same way we unlink targets from observers when they are deleted.
In worst case we keep root elements (which tend to contain a larger node tree) alive unnecessarily.
Assignee: nobody → tschneider
Priority: -- → P3
Depends on: 1316277
Comment on attachment 8912009 [details] [diff] [review]
Stop observing a target when intersection root is deleted

Blake, this patch is building up on which you already reviewed. So I figured it a good idea having you reviewing this as well. I discussed this change with dholbert on IRC and we agreed on using the same hashtable for keeping links between elements and  intersection observers, whether they are observing the element or using it as the root element for intersections. We already have everything in place to unlink those pointers properly so it made sense to share this functionality rather then copy and pasting most of the code to introduce yet another list of intersection observer pointers.
Attachment #8912009 - Flags: review?(mrbkap)
Attachment #8912009 - Flags: review?(mrbkap) → review+
Pushed by
[intersection-observer] Stop observing a target when intersection root is deleted. r=mrbkap
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
This by all means is wrong. IntersectionObserver has attribute root, and if that magically becomes null after GC, we have exposed GC behavior to the web.
I filed
Depends on: 1422092
This was backed out from all branches in bug 1422092.
Resolution: FIXED → WONTFIX
You need to log in before you can comment on or make changes to this bug.