Created attachment 409963 [details] Test file to reproduce form and input element leak When a form with an input inside of it is detached and dereferenced, the memory associated with the form is not GC'ed Steps to reproduce: - Open provided example file in Safari (Desktop). (tested in Version 14.0 (15610.1.28.1.9, 15610), no extensions) - Open up Web Inspector -> Timelines -> Javascript Allocations. - Take a snapshot. - Click 'Click to add form' button a few times (mounts and unmounts a form and an input). - Take a snapshot. - Compare snapshots. Expected - No leaked memory Actual - The HTMLFormElement and HTMLInputElements are leaked. Notes: - Does not happen on iOS Safari with same webkit versions. - If its a stand alone <input> without a wrapping <form>, the same behaviour does not occur. - If there is no <input> inside the <form>, the HTMLFormElement is not leaked. - Looking at the path to root object within the snapshot inspector for the HTMLFormElement shows either: a) "This object is a root" b) A retaining path from an object via a property called "_controlUniqueIDToControlMap"
Thank you for the report, and for the detailed analysis. This looks like an issue in Safari forms autofill code, not in WebKit. Keeping this open because I'm not entirely certain, but also importing to Apple internal system for investigation.
<rdar://problem/69750302>
Thanks for cross reporting to the Apple internal system Alexey. Is there a way to get some transparency on the progress of the ticket? Does the internal system auto report progress back out to the public system?
I think that the best way would be for you to file your own report via feedbackassistant.apple.com, and then we could dupe mine to it. This way, you will have all standard communication via feedback assistant. Please post the report number here is you choose to go this path (it will start with FB). Marking INVALID, as I think we confirmed this to be a Safari issue.
Done: FB8828701