Fix panic in formelement.rs (#37459)

Use borrowing directly with iterators instead of holding the borrowed
value for a longer scope.

Testing: Covered by existing tests, and manual testing with the test
case from https://github.com/servo/servo/issues/37430
Fixes: https://github.com/servo/servo/issues/37430

Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
webbeef 2025-06-16 05:41:37 -07:00 committed by GitHub
parent bcade589e7
commit 910cc0b687
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 24 additions and 10 deletions

View file

@ -8241,6 +8241,13 @@
{}
]
],
"form-check-validity-crash.html": [
"6d3bd0d2e36751c554af42164189d921975ced93",
[
null,
{}
]
],
"form-controls-id-removal-crash.html": [
"2b1ef87774fc1c5393129fca8e65147c379ea7a9",
[

View file

@ -0,0 +1,8 @@
<!DOCTYPE html>
<div id="container">
<form id="formId"></form>
</div>
<input id="inputId" required form="formId" oninvalid="container.remove()">
<script>
formId.checkValidity();
</script>