summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorKenneth Myhra <kennethmyhra@gmail.com>2023-03-05 10:53:19 +0100
committerLinus Groh <mail@linusgroh.de>2023-03-05 18:25:59 +0000
commitbb7ae423d5deb6be83f4cdada353422cb10f3714 (patch)
treeef197d27455359f9dd6dae09028199077205a40e /Userland
parenteed69e5093011aad0663a705c982302180dd0c64 (diff)
downloadserenity-bb7ae423d5deb6be83f4cdada353422cb10f3714.zip
LibWeb: Port FormDataEvent to new String
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp2
-rw-r--r--Userland/Libraries/LibWeb/HTML/FormDataEvent.cpp6
-rw-r--r--Userland/Libraries/LibWeb/HTML/FormDataEvent.h4
-rw-r--r--Userland/Libraries/LibWeb/HTML/FormDataEvent.idl2
4 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp b/Userland/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp
index c261bb2be2..bd28b553aa 100644
--- a/Userland/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp
+++ b/Userland/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp
@@ -164,7 +164,7 @@ WebIDL::ExceptionOr<Optional<Vector<XHR::FormDataEntry>>> construct_entry_list(J
// 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 {};
init.form_data = form_data;
- auto form_data_event = TRY(FormDataEvent::construct_impl(realm, HTML::EventNames::formdata, init));
+ auto form_data_event = TRY(FormDataEvent::construct_impl(realm, String::from_deprecated_string(HTML::EventNames::formdata).release_value_but_fixme_should_propagate_errors(), init));
form_data_event->set_bubbles(true);
form.dispatch_event(form_data_event);
diff --git a/Userland/Libraries/LibWeb/HTML/FormDataEvent.cpp b/Userland/Libraries/LibWeb/HTML/FormDataEvent.cpp
index aa5fa25f11..1337970c23 100644
--- a/Userland/Libraries/LibWeb/HTML/FormDataEvent.cpp
+++ b/Userland/Libraries/LibWeb/HTML/FormDataEvent.cpp
@@ -10,13 +10,13 @@
namespace Web::HTML {
-WebIDL::ExceptionOr<JS::NonnullGCPtr<FormDataEvent>> FormDataEvent::construct_impl(JS::Realm& realm, DeprecatedString const& event_name, FormDataEventInit const& event_init)
+WebIDL::ExceptionOr<JS::NonnullGCPtr<FormDataEvent>> FormDataEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, FormDataEventInit const& event_init)
{
return MUST_OR_THROW_OOM(realm.heap().allocate<FormDataEvent>(realm, realm, event_name, event_init));
}
-FormDataEvent::FormDataEvent(JS::Realm& realm, DeprecatedString const& event_name, FormDataEventInit const& event_init)
- : DOM::Event(realm, event_name, event_init)
+FormDataEvent::FormDataEvent(JS::Realm& realm, FlyString const& event_name, FormDataEventInit const& event_init)
+ : DOM::Event(realm, event_name.to_deprecated_fly_string(), event_init)
, m_form_data(event_init.form_data)
{
}
diff --git a/Userland/Libraries/LibWeb/HTML/FormDataEvent.h b/Userland/Libraries/LibWeb/HTML/FormDataEvent.h
index 3c2a4254e2..cd32e21311 100644
--- a/Userland/Libraries/LibWeb/HTML/FormDataEvent.h
+++ b/Userland/Libraries/LibWeb/HTML/FormDataEvent.h
@@ -19,14 +19,14 @@ class FormDataEvent final : public DOM::Event {
WEB_PLATFORM_OBJECT(FormDataEvent, DOM::Event);
public:
- static WebIDL::ExceptionOr<JS::NonnullGCPtr<FormDataEvent>> construct_impl(JS::Realm&, DeprecatedString const& event_name, FormDataEventInit const& event_init);
+ static WebIDL::ExceptionOr<JS::NonnullGCPtr<FormDataEvent>> construct_impl(JS::Realm&, FlyString const& event_name, FormDataEventInit const& event_init);
virtual ~FormDataEvent() override;
JS::GCPtr<XHR::FormData> form_data() const { return m_form_data; }
private:
- FormDataEvent(JS::Realm&, DeprecatedString const& event_name, FormDataEventInit const& event_init);
+ FormDataEvent(JS::Realm&, FlyString const& event_name, FormDataEventInit const& event_init);
JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
diff --git a/Userland/Libraries/LibWeb/HTML/FormDataEvent.idl b/Userland/Libraries/LibWeb/HTML/FormDataEvent.idl
index 3b198d7658..d21e8116d3 100644
--- a/Userland/Libraries/LibWeb/HTML/FormDataEvent.idl
+++ b/Userland/Libraries/LibWeb/HTML/FormDataEvent.idl
@@ -2,7 +2,7 @@
#import <XHR/FormData.idl>
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#the-formdataevent-interface
-[Exposed=Window]
+[Exposed=Window, UseNewAKString]
interface FormDataEvent : Event {
constructor(DOMString type, FormDataEventInit eventInitDict);