diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp b/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp index 95580d9f86..3d416284d0 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp +++ b/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp @@ -9,12 +9,12 @@ namespace Web::WebGL { -WebGLContextEvent* WebGLContextEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, WebGLContextEventInit const& event_init) +WebIDL::ExceptionOr> WebGLContextEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, WebGLContextEventInit const& event_init) { - return realm.heap().allocate(realm, realm, event_name, event_init).release_allocated_value_but_fixme_should_propagate_errors(); + return MUST_OR_THROW_OOM(realm.heap().allocate(realm, realm, event_name, event_init)); } -WebGLContextEvent* WebGLContextEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, WebGLContextEventInit const& event_init) +WebIDL::ExceptionOr> WebGLContextEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, WebGLContextEventInit const& event_init) { return create(realm, event_name, event_init); } diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.h b/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.h index 08f3f67676..71b2bd6294 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.h +++ b/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.h @@ -19,8 +19,8 @@ class WebGLContextEvent final : public DOM::Event { WEB_PLATFORM_OBJECT(WebGLContextEvent, DOM::Event); public: - static WebGLContextEvent* create(JS::Realm&, DeprecatedFlyString const& type, WebGLContextEventInit const& event_init); - static WebGLContextEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& type, WebGLContextEventInit const& event_init); + static WebIDL::ExceptionOr> create(JS::Realm&, DeprecatedFlyString const& type, WebGLContextEventInit const& event_init); + static WebIDL::ExceptionOr> construct_impl(JS::Realm&, DeprecatedFlyString const& type, WebGLContextEventInit const& event_init); virtual ~WebGLContextEvent() override; diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp index 7f166290ed..7b66b95678 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp +++ b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp @@ -17,7 +17,7 @@ static void fire_webgl_context_event(HTML::HTMLCanvasElement& canvas_element, De { // To fire a WebGL context event named e means that an event using the WebGLContextEvent interface, with its type attribute [DOM4] initialized to e, its cancelable attribute initialized to true, and its isTrusted attribute [DOM4] initialized to true, is to be dispatched at the given object. // FIXME: Consider setting a status message. - auto event = WebGLContextEvent::create(canvas_element.realm(), type, WebGLContextEventInit {}); + auto event = WebGLContextEvent::create(canvas_element.realm(), type, WebGLContextEventInit {}).release_value_but_fixme_should_propagate_errors(); event->set_is_trusted(true); event->set_cancelable(true); canvas_element.dispatch_event(*event);