mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Fix BorrowMutError crash in form reset (#36726)
Fixes: #36724 Signed-off-by: Taym <haddadi.taym@gmail.com>
This commit is contained in:
parent
e79520c25a
commit
b6a89ae408
3 changed files with 22 additions and 2 deletions
|
@ -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() {
|
||||
|
|
7
tests/wpt/mozilla/meta/MANIFEST.json
vendored
7
tests/wpt/mozilla/meta/MANIFEST.json
vendored
|
@ -25,6 +25,13 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"form_reset-crash.html": [
|
||||
"b23cbf6aefdef8231e2cc4cb0e6416195d5bdf71",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
]
|
||||
],
|
||||
"global-enumerate-crash.html": [
|
||||
"a77e79b1465bf7555340dd5e9bf94a4c8caa85f2",
|
||||
[
|
||||
|
|
7
tests/wpt/mozilla/tests/mozilla/form_reset-crash.html
vendored
Normal file
7
tests/wpt/mozilla/tests/mozilla/form_reset-crash.html
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<form id="form">
|
||||
<output><textarea></textarea></output>
|
||||
</form>
|
||||
<script>
|
||||
form.reset();
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue