mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 00:37:34 +00:00
LibWeb: Skip anchor activation behavior if the click event was cancelled
This commit is contained in:
parent
cc411b328c
commit
a2bc97a9c2
1 changed files with 51 additions and 48 deletions
|
@ -194,6 +194,12 @@ bool EventHandler::handle_mouseup(Gfx::IntPoint const& position, unsigned button
|
|||
node->dispatch_event(UIEvents::MouseEvent::create(UIEvents::EventNames::mouseup, offset.x(), offset.y(), position.x(), position.y()));
|
||||
handled_event = true;
|
||||
|
||||
bool run_activation_behavior = true;
|
||||
if (node.ptr() == m_mousedown_target && button == GUI::MouseButton::Primary) {
|
||||
run_activation_behavior = node->dispatch_event(UIEvents::MouseEvent::create(UIEvents::EventNames::click, offset.x(), offset.y(), position.x(), position.y()));
|
||||
}
|
||||
|
||||
if (run_activation_behavior) {
|
||||
// FIXME: This is ad-hoc and incorrect. The reason this exists is
|
||||
// because we are missing browsing context navigation:
|
||||
//
|
||||
|
@ -241,9 +247,6 @@ bool EventHandler::handle_mouseup(Gfx::IntPoint const& position, unsigned button
|
|||
page->client().page_did_request_context_menu(m_browsing_context.to_top_level_position(position));
|
||||
}
|
||||
}
|
||||
|
||||
if (node.ptr() == m_mousedown_target && button == GUI::MouseButton::Primary) {
|
||||
node->dispatch_event(UIEvents::MouseEvent::create(UIEvents::EventNames::click, offset.x(), offset.y(), position.x(), position.y()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue