Re: [whatwg/dom] May return the same HTMLCollection object (#706)

Browsers don't hold strong references to the returned collections right now,  as far as I know.   Gecko certainly does not.

Live collections cache things (at least in Gecko); they don't recompute on every access.  So the overhead of a live collection is:

1) Whatever it has cached at the moment.
2) Whatever mutation observers it needs to add to invalidate its cache as needed.
3) The memory for the collection itself.
4) If holding strong references, whatever data structure holds those strong references.

It's not 100% clear what the desired lifetime of a collection would be if we held strong references to them.  Should it basically be tied to the lifetime of the node the collection is rooted at?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/706#issuecomment-431018413

Received on Thursday, 18 October 2018 13:56:56 UTC