ResizeObserver is clearly bogus because I think we just keep the objects alive for too long. But for
IntersectionObserver I'm not quite sure what's going on. When I add some CC logging I see stuff like this:
Root 0x7f919979ec00 is a ref counted object with 0 unknown edge(s).
0x7f9199603ca0 [FragmentOrElement (xhtml) div (orphan) https://static-misc-3.glitch.me/leaky-resize-observer/] ----> 0x7f919979ec00
It is an incremental root, which means it was touched during an incremental CC.
Which seems to me like we figured out we're basically only referenced by an orphan node.
When I check the logs for the element I see:
Parsing cclogs/cc-edges.74472-2.log. Done loading graph.
--[mParent]--> 0x7f9199603ca0 [FragmentOrElement (xhtml) div (orphan) https://static-misc-3.glitch.me/leaky-resize-observer/]
Root 0x7f919979d1c0 is a ref counted object with 1 unknown edge(s).
DOMRect is the return value of
getBoundingClientRect from the callback, but it seems we can't figure out the edge that comes from the callback until we run a full GC or something? On the last CC I see instead:
Didn't find a path.
0x216e5563d4c0 [JS Object (HTMLDivElement)] --[UnwrapDOMObject(obj)]--> 0x7f9199603ca0
Which is the edge that we were missing before most likely... Do you know why we can't find this edge sooner Andrew? Is it just because we don't do a full GC soon enough? We do free the
IntersectionObservers if I click "Minimize memory usage" in about:memory... Are we incorrectly skipping tracing of some stuff or what not?
Status: UNCONFIRMED → NEW
Component: Layout → DOM: Core & HTML
Ever confirmed: true