From b1966651312610e96059689c8d27e9502b6f3dc1 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 21 Mar 2020 17:55:41 +0100 Subject: [PATCH] LibWeb: Dispatch "mouseup" event This is a very naive implementation that doesn't account for where the mousedown happened. --- Libraries/LibWeb/HtmlView.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Libraries/LibWeb/HtmlView.cpp b/Libraries/LibWeb/HtmlView.cpp index cdb608e66d..5a2ddb9dfe 100644 --- a/Libraries/LibWeb/HtmlView.cpp +++ b/Libraries/LibWeb/HtmlView.cpp @@ -248,6 +248,12 @@ void HtmlView::mouseup_event(GUI::MouseEvent& event) if (!layout_root()) return GUI::ScrollableWidget::mouseup_event(event); + auto result = layout_root()->hit_test(to_content_position(event.position())); + if (result.layout_node) { + if (auto* node = result.layout_node->node()) + const_cast(node)->dispatch_event("mouseup"); + } + if (event.button() == GUI::MouseButton::Left) { dump_selection("MouseUp"); m_in_mouse_selection = false;