Fix BorrowMutError crash in form reset (#36726)

Fixes: #36724

Signed-off-by: Taym <haddadi.taym@gmail.com>
This commit is contained in:
Taym Haddadi 2025-04-29 20:59:50 +02:00 committed by GitHub
parent e79520c25a
commit b6a89ae408
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 2 deletions

View file

@ -1270,8 +1270,14 @@ impl HTMLFormElement {
return;
}
let controls = self.controls.borrow();
for child in controls.iter() {
let controls: Vec<_> = self
.controls
.borrow()
.iter()
.map(|c| c.as_rooted())
.collect();
for child in controls {
let child = child.upcast::<Node>();
match child.type_id() {