Closed
Bug 1399603
Opened 7 years ago
Closed 7 years ago
[intersection-observer] Stop observing a target when intersection root is deleted
Categories
(Core :: Layout, enhancement, P3)
Core
Layout
Tracking
()
RESOLVED
WONTFIX
mozilla58
People
(Reporter: tschneider, Assigned: tschneider)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
6.66 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
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 | ||
Updated•7 years ago
|
Assignee: nobody → tschneider
Assignee | ||
Updated•7 years ago
|
Blocks: intersection-observer
Updated•7 years ago
|
Priority: -- → P3
Updated•7 years ago
|
status-firefox57:
--- → wontfix
Assignee | ||
Comment 1•7 years ago
|
||
Assignee | ||
Comment 2•7 years ago
|
||
Comment on attachment 8912009 [details] [diff] [review]
Stop observing a target when intersection root is deleted
Blake, this patch is building up on https://bugzilla.mozilla.org/show_bug.cgi?id=1316277 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)
Updated•7 years ago
|
Attachment #8912009 -
Flags: review?(mrbkap) → review+
Pushed by tschneider@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f70abea8b810
[intersection-observer] Stop observing a target when intersection root is deleted. r=mrbkap
Comment 4•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Assignee | ||
Comment 5•7 years ago
|
||
Try run before landing: https://treeherder.mozilla.org/#/jobs?repo=try&revision=1eab0601b12e4ceba20c5958d1bf1defd51aae1e
Comment 6•7 years ago
|
||
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 https://github.com/w3c/IntersectionObserver/issues/275
Comment 7•7 years ago
|
||
This was backed out from all branches in bug 1422092.
You need to log in
before you can comment on or make changes to this bug.
Description
•