diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-25 23:11:51 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-25 23:36:43 +0200 |
commit | 0ee457dfdf725cc21afcd24d4075a2c19be30676 (patch) | |
tree | f6de74b743824632dbfaafbd96bb92ceb1f0eb56 /Userland/Libraries/LibWeb/HTML | |
parent | 8dcf4e0346610c163fbb37727ff6038e2edd4ce9 (diff) | |
download | serenity-0ee457dfdf725cc21afcd24d4075a2c19be30676.zip |
LibWeb: Provide a default DOM::EventTarget::dispatch_event()
All EventTarget subclasses except Window do the same exact thing in
their overrides, so let's just share an implementation in the base.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/MessagePort.cpp | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/MessagePort.h | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/WebSocket.cpp | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/WebSocket.h | 1 |
4 files changed, 0 insertions, 12 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/MessagePort.cpp b/Userland/Libraries/LibWeb/HTML/MessagePort.cpp index f80e943781..4684a726d1 100644 --- a/Userland/Libraries/LibWeb/HTML/MessagePort.cpp +++ b/Userland/Libraries/LibWeb/HTML/MessagePort.cpp @@ -84,11 +84,6 @@ void MessagePort::post_message(JS::Value message) })); } -bool MessagePort::dispatch_event(NonnullRefPtr<DOM::Event> event) -{ - return DOM::EventDispatcher::dispatch(*this, move(event)); -} - JS::Object* MessagePort::create_wrapper(JS::GlobalObject& global_object) { return wrap(global_object, *this); diff --git a/Userland/Libraries/LibWeb/HTML/MessagePort.h b/Userland/Libraries/LibWeb/HTML/MessagePort.h index 18446b8e5f..d6db384464 100644 --- a/Userland/Libraries/LibWeb/HTML/MessagePort.h +++ b/Userland/Libraries/LibWeb/HTML/MessagePort.h @@ -40,7 +40,6 @@ public: // ^EventTarget virtual void ref_event_target() override { ref(); } virtual void unref_event_target() override { unref(); } - virtual bool dispatch_event(NonnullRefPtr<DOM::Event>) override; virtual JS::Object* create_wrapper(JS::GlobalObject&) override; // https://html.spec.whatwg.org/multipage/web-messaging.html#entangle diff --git a/Userland/Libraries/LibWeb/HTML/WebSocket.cpp b/Userland/Libraries/LibWeb/HTML/WebSocket.cpp index 2a067cb142..bd50c022ef 100644 --- a/Userland/Libraries/LibWeb/HTML/WebSocket.cpp +++ b/Userland/Libraries/LibWeb/HTML/WebSocket.cpp @@ -207,11 +207,6 @@ void WebSocket::on_message(ByteBuffer message, bool is_text) TODO(); } -bool WebSocket::dispatch_event(NonnullRefPtr<DOM::Event> event) -{ - return DOM::EventDispatcher::dispatch(*this, move(event)); -} - JS::Object* WebSocket::create_wrapper(JS::GlobalObject& global_object) { return wrap(global_object, *this); diff --git a/Userland/Libraries/LibWeb/HTML/WebSocket.h b/Userland/Libraries/LibWeb/HTML/WebSocket.h index 6491739dcd..4748b5dc47 100644 --- a/Userland/Libraries/LibWeb/HTML/WebSocket.h +++ b/Userland/Libraries/LibWeb/HTML/WebSocket.h @@ -91,7 +91,6 @@ public: private: virtual void ref_event_target() override { ref(); } virtual void unref_event_target() override { unref(); } - virtual bool dispatch_event(NonnullRefPtr<DOM::Event>) override; virtual JS::Object* create_wrapper(JS::GlobalObject&) override; void on_open(); |