1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:27: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:
Andreas Kling 2021-09-25 23:11:51 +02:00
parent 8dcf4e0346
commit 0ee457dfdf
16 changed files with 8 additions and 43 deletions

View file

@ -37,11 +37,6 @@ bool MediaQueryList::matches() const
return false;
}
bool MediaQueryList::dispatch_event(NonnullRefPtr<DOM::Event> event)
{
return DOM::EventDispatcher::dispatch(*this, event);
}
JS::Object* MediaQueryList::create_wrapper(JS::GlobalObject& global_object)
{
return wrap(global_object, *this);

View file

@ -39,7 +39,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;
void add_listener(RefPtr<DOM::EventListener> listener);