diff options
author | Andrew Kaster <akaster@serenityos.org> | 2022-09-25 16:38:21 -0600 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-10-01 21:05:32 +0100 |
commit | f0c5f77f99801441db1d8e99c14dae2ab1357b47 (patch) | |
tree | 4c96ecfef6414f247421a8abf52168592fd0ab92 /Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp | |
parent | a2ccb00e1da76b9b80fe1a804b5cbf87af91770f (diff) | |
download | serenity-f0c5f77f99801441db1d8e99c14dae2ab1357b47.zip |
LibWeb: Remove unecessary dependence on Window from HTML classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct HTML classes.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp b/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp index 684e476341..d1470fdace 100644 --- a/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp @@ -4,26 +4,26 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include <LibWeb/Bindings/Intrinsics.h> #include <LibWeb/HTML/SubmitEvent.h> -#include <LibWeb/HTML/Window.h> namespace Web::HTML { -SubmitEvent* SubmitEvent::create(HTML::Window& window_object, FlyString const& event_name, SubmitEventInit const& event_init) +SubmitEvent* SubmitEvent::create(JS::Realm& realm, FlyString const& event_name, SubmitEventInit const& event_init) { - return window_object.heap().allocate<SubmitEvent>(window_object.realm(), window_object, event_name, event_init); + return realm.heap().allocate<SubmitEvent>(realm, realm, event_name, event_init); } -SubmitEvent* SubmitEvent::create_with_global_object(HTML::Window& window_object, FlyString const& event_name, SubmitEventInit const& event_init) +SubmitEvent* SubmitEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, SubmitEventInit const& event_init) { - return create(window_object, event_name, event_init); + return create(realm, event_name, event_init); } -SubmitEvent::SubmitEvent(HTML::Window& window_object, FlyString const& event_name, SubmitEventInit const& event_init) - : DOM::Event(window_object, event_name, event_init) +SubmitEvent::SubmitEvent(JS::Realm& realm, FlyString const& event_name, SubmitEventInit const& event_init) + : DOM::Event(realm, event_name, event_init) , m_submitter(event_init.submitter) { - set_prototype(&window_object.cached_web_prototype("SubmitEvent")); + set_prototype(&Bindings::cached_web_prototype(realm, "SubmitEvent")); } SubmitEvent::~SubmitEvent() = default; |