summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/DOM/Event.cpp
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2023-01-10 06:56:59 -0500
committerAndreas Kling <kling@serenityos.org>2023-01-10 16:08:14 +0100
commitaf75493883762b5726da825a01f5ec305a6c3e56 (patch)
treee5137f72bd22abe47ffb94bf16348caf65b207d3 /Userland/Libraries/LibWeb/DOM/Event.cpp
parent834202aeb9a47c544ab4e61deb813de50bc03946 (diff)
downloadserenity-af75493883762b5726da825a01f5ec305a6c3e56.zip
LibWeb: Move passing of Web object prototypes out of constructors
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/Event.cpp')
-rw-r--r--Userland/Libraries/LibWeb/DOM/Event.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Event.cpp b/Userland/Libraries/LibWeb/DOM/Event.cpp
index a42a587e52..ae6e12692a 100644
--- a/Userland/Libraries/LibWeb/DOM/Event.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Event.cpp
@@ -25,14 +25,14 @@ JS::NonnullGCPtr<Event> Event::construct_impl(JS::Realm& realm, DeprecatedFlyStr
}
Event::Event(JS::Realm& realm, DeprecatedFlyString const& type)
- : PlatformObject(Bindings::cached_web_prototype(realm, "Event"))
+ : PlatformObject(realm)
, m_type(type)
, m_initialized(true)
{
}
Event::Event(JS::Realm& realm, DeprecatedFlyString const& type, EventInit const& event_init)
- : PlatformObject(Bindings::cached_web_prototype(realm, "Event"))
+ : PlatformObject(realm)
, m_type(type)
, m_bubbles(event_init.bubbles)
, m_cancelable(event_init.cancelable)
@@ -41,6 +41,12 @@ Event::Event(JS::Realm& realm, DeprecatedFlyString const& type, EventInit const&
{
}
+void Event::initialize(JS::Realm& realm)
+{
+ Base::initialize(realm);
+ set_prototype(&Bindings::ensure_web_prototype<Bindings::EventPrototype>(realm, "Event"));
+}
+
void Event::visit_edges(Visitor& visitor)
{
Base::visit_edges(visitor);