summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Page/EventHandler.cpp
diff options
context:
space:
mode:
authorLuke <luke.wilde@live.co.uk>2020-11-21 19:15:57 +0000
committerAndreas Kling <kling@serenityos.org>2020-11-22 18:20:56 +0100
commit99502708087031172bca0e0dc423b28d82517ea8 (patch)
tree3c7d4b5050d8f7c2987474689f6f713c0a4b311c /Libraries/LibWeb/Page/EventHandler.cpp
parente68348298f1f0905d6014c8bd5f6da2a3b6233d8 (diff)
downloadserenity-99502708087031172bca0e0dc423b28d82517ea8.zip
LibWeb: Add HTML::EventNames and UIEvents::EventNames
Diffstat (limited to 'Libraries/LibWeb/Page/EventHandler.cpp')
-rw-r--r--Libraries/LibWeb/Page/EventHandler.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Libraries/LibWeb/Page/EventHandler.cpp b/Libraries/LibWeb/Page/EventHandler.cpp
index e7e310ab31..8cd28f59dc 100644
--- a/Libraries/LibWeb/Page/EventHandler.cpp
+++ b/Libraries/LibWeb/Page/EventHandler.cpp
@@ -36,6 +36,7 @@
#include <LibWeb/Layout/InitialContainingBlockBox.h>
#include <LibWeb/Page/EventHandler.h>
#include <LibWeb/Page/Frame.h>
+#include <LibWeb/UIEvents/EventNames.h>
#include <LibWeb/UIEvents/MouseEvent.h>
namespace Web {
@@ -103,7 +104,7 @@ bool EventHandler::handle_mouseup(const Gfx::IntPoint& position, unsigned button
return false;
}
auto offset = compute_mouse_event_offset(position, *result.layout_node);
- node->dispatch_event(UIEvents::MouseEvent::create("mouseup", offset.x(), offset.y()));
+ node->dispatch_event(UIEvents::MouseEvent::create(UIEvents::EventNames::mouseup, offset.x(), offset.y()));
handled_event = true;
}
@@ -151,7 +152,7 @@ bool EventHandler::handle_mousedown(const Gfx::IntPoint& position, unsigned butt
page->set_focused_frame({}, m_frame);
auto offset = compute_mouse_event_offset(position, *result.layout_node);
- node->dispatch_event(UIEvents::MouseEvent::create("mousedown", offset.x(), offset.y()));
+ node->dispatch_event(UIEvents::MouseEvent::create(UIEvents::EventNames::mousedown, offset.x(), offset.y()));
if (!layout_root())
return true;
@@ -253,7 +254,7 @@ bool EventHandler::handle_mousemove(const Gfx::IntPoint& position, unsigned butt
if (hovered_link_element)
is_hovering_link = true;
auto offset = compute_mouse_event_offset(position, *result.layout_node);
- node->dispatch_event(UIEvents::MouseEvent::create("mousemove", offset.x(), offset.y()));
+ node->dispatch_event(UIEvents::MouseEvent::create(UIEvents::EventNames::mousemove, offset.x(), offset.y()));
if (!layout_root())
return true;
}