diff options
Diffstat (limited to 'Libraries/LibWeb/Page')
-rw-r--r-- | Libraries/LibWeb/Page/EventHandler.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Libraries/LibWeb/Page/EventHandler.cpp b/Libraries/LibWeb/Page/EventHandler.cpp index cba26e89ba..d9623b8105 100644 --- a/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Libraries/LibWeb/Page/EventHandler.cpp @@ -31,10 +31,10 @@ #include <LibWeb/DOM/Text.h> #include <LibWeb/HTML/HTMLAnchorElement.h> #include <LibWeb/HTML/HTMLIFrameElement.h> +#include <LibWeb/InProcessWebView.h> #include <LibWeb/Layout/LayoutDocument.h> #include <LibWeb/Page/EventHandler.h> #include <LibWeb/Page/Frame.h> -#include <LibWeb/InProcessWebView.h> #include <LibWeb/UIEvents/MouseEvent.h> namespace Web { @@ -156,8 +156,7 @@ bool EventHandler::handle_mousedown(const Gfx::IntPoint& position, unsigned butt auto result = layout_root()->hit_test(position, HitTestType::TextCursor); if (result.layout_node && result.layout_node->node()) { m_frame.set_cursor_position(DOM::Position(*node, result.index_in_node)); - layout_root()->selection().set({ result.layout_node, result.index_in_node }, {}); - layout_root()->recompute_selection_states(); + layout_root()->set_selection({ { result.layout_node, result.index_in_node }, {} }); dump_selection("MouseDown"); m_in_mouse_selection = true; } @@ -209,8 +208,7 @@ bool EventHandler::handle_mousemove(const Gfx::IntPoint& position, unsigned butt if (m_in_mouse_selection) { auto hit = layout_root()->hit_test(position, HitTestType::TextCursor); if (hit.layout_node && hit.layout_node->node()) { - layout_root()->selection().set_end({ hit.layout_node, hit.index_in_node }); - layout_root()->recompute_selection_states(); + layout_root()->set_selection_end({ hit.layout_node, hit.index_in_node }); } dump_selection("MouseMove"); page_client.page_did_change_selection(); |