mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:37:35 +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
|
@ -11,6 +11,7 @@
|
|||
#include <LibWeb/Bindings/ScriptExecutionContext.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
#include <LibWeb/DOM/EventDispatcher.h>
|
||||
#include <LibWeb/DOM/EventListener.h>
|
||||
#include <LibWeb/DOM/EventTarget.h>
|
||||
#include <LibWeb/DOM/Window.h>
|
||||
|
@ -147,4 +148,10 @@ void EventTarget::set_event_handler_attribute(FlyString const& name, HTML::Event
|
|||
target->add_event_listener(name, listener.release_nonnull());
|
||||
}
|
||||
}
|
||||
|
||||
bool EventTarget::dispatch_event(NonnullRefPtr<Event> event)
|
||||
{
|
||||
return EventDispatcher::dispatch(*this, move(event));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue