mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 00:38:48 +00:00
LibWeb: Allow FormData entry list to be mutated within a FormDataEvent
Previously, the list was copied when constructing the FormData object, then the original list was passed to the event, meaning any changes to the list that happened within the event would not be reflected outside of it.
This commit is contained in:
parent
4cb19c65b4
commit
ea0e434d1d
Notes:
github-actions[bot]
2024-11-21 19:26:21 +00:00
Author: https://github.com/tcl3
Commit: ea0e434d1d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2480
3 changed files with 23 additions and 2 deletions
|
@ -201,7 +201,7 @@ WebIDL::ExceptionOr<Optional<Vector<XHR::FormDataEntry>>> construct_entry_list(J
|
|||
}
|
||||
}
|
||||
// 6. Let form data be a new FormData object associated with entry list.
|
||||
auto form_data = TRY(XHR::FormData::construct_impl(realm, entry_list));
|
||||
auto form_data = TRY(XHR::FormData::construct_impl(realm, move(entry_list)));
|
||||
|
||||
// 7. Fire an event named formdata at form using FormDataEvent, with the formData attribute initialized to form data and the bubbles attribute initialized to true.
|
||||
FormDataEventInit init {};
|
||||
|
@ -214,7 +214,7 @@ WebIDL::ExceptionOr<Optional<Vector<XHR::FormDataEntry>>> construct_entry_list(J
|
|||
form.set_constructing_entry_list(false);
|
||||
|
||||
// 9. Return a clone of entry list.
|
||||
return entry_list;
|
||||
return form_data->entry_list();
|
||||
}
|
||||
|
||||
ErrorOr<String> normalize_line_breaks(StringView value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue