mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:48:14 +00:00
LibWeb: Make factory method of HTML::SubmitEvent fallible
This commit is contained in:
parent
c5de2c3348
commit
809206f50e
3 changed files with 6 additions and 6 deletions
|
@ -83,7 +83,7 @@ void HTMLFormElement::submit_form(JS::GCPtr<HTMLElement> submitter, bool from_su
|
|||
|
||||
SubmitEventInit event_init {};
|
||||
event_init.submitter = submitter_button;
|
||||
auto submit_event = SubmitEvent::create(realm(), EventNames::submit, event_init);
|
||||
auto submit_event = SubmitEvent::create(realm(), EventNames::submit, event_init).release_value_but_fixme_should_propagate_errors();
|
||||
submit_event->set_bubbles(true);
|
||||
submit_event->set_cancelable(true);
|
||||
bool continue_ = dispatch_event(*submit_event);
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
|
||||
namespace Web::HTML {
|
||||
|
||||
SubmitEvent* SubmitEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<SubmitEvent>> SubmitEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<SubmitEvent>(realm, realm, event_name, event_init).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
return MUST_OR_THROW_OOM(realm.heap().allocate<SubmitEvent>(realm, realm, event_name, event_init));
|
||||
}
|
||||
|
||||
SubmitEvent* SubmitEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<SubmitEvent>> SubmitEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init)
|
||||
{
|
||||
return create(realm, event_name, event_init);
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@ class SubmitEvent final : public DOM::Event {
|
|||
WEB_PLATFORM_OBJECT(SubmitEvent, DOM::Event);
|
||||
|
||||
public:
|
||||
static SubmitEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init);
|
||||
static SubmitEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init);
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<SubmitEvent>> create(JS::Realm&, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init);
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<SubmitEvent>> construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init);
|
||||
|
||||
virtual ~SubmitEvent() override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue