Pārlūkot izejas kodu

LibWeb: Remove `navigate()` in `EventHandler::handle_mouseup()`

Before this change `navigate()` was always invoked twice when a link
is clicked:
- From `activation_behavior` callback of `HTMLAnchorElement` during
  event dispatch.
- Directly from `handle_mouseup`.
Aliaksandr Kalenik 1 gadu atpakaļ
vecāks
revīzija
7b3559f1c2
1 mainītis faili ar 1 papildinājumiem un 3 dzēšanām
  1. 1 3
      Userland/Libraries/LibWeb/Page/EventHandler.cpp

+ 1 - 3
Userland/Libraries/LibWeb/Page/EventHandler.cpp

@@ -284,9 +284,7 @@ bool EventHandler::handle_mouseup(CSSPixelPoint position, CSSPixelPoint screen_p
                     auto href = link->href();
                     auto url = document->parse_url(href);
                     dbgln("Web::EventHandler: Clicking on a link to {}", url);
-                    if (button == GUI::MouseButton::Primary) {
-                        MUST(document->navigable()->navigate({ .url = url, .source_document = document }));
-                    } else if (button == GUI::MouseButton::Middle) {
+                    if (button == GUI::MouseButton::Middle) {
                         if (auto* page = m_browsing_context->page())
                             page->client().page_did_middle_click_link(url, link->target(), modifiers);
                     } else if (button == GUI::MouseButton::Secondary) {