mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-24 02:09:28 +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:
committed by
Andreas Kling
parent
4cb19c65b4
commit
ea0e434d1d
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user