1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:07:34 +00:00

LibWeb: Add a DOM Event class (instead of events being simple strings)

This patch adds the Event base class, along with a MouseEvent subclass.
We now dispatch MouseEvent objects for mousedown, mouseup and mousemove
and these objects have the .offsetX and .offsetY properties.

Both of those properties are hard-coded at the moment. This will be
fixed in the next patch. :^)
This commit is contained in:
Andreas Kling 2020-03-21 18:17:18 +01:00
parent b196665131
commit 4dde36844b
15 changed files with 311 additions and 10 deletions

View file

@ -45,7 +45,7 @@ public:
void add_event_listener(String event_name, NonnullRefPtr<EventListener>);
virtual void dispatch_event(String event_name) = 0;
virtual void dispatch_event(NonnullRefPtr<Event>) = 0;
struct EventListenerRegistration {
String event_name;