mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:37:45 +00:00
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.
This commit is contained in:
parent
8dcf4e0346
commit
0ee457dfdf
16 changed files with 8 additions and 43 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue