From 747b21782e9a93987cffb6899bc3146778677e00 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 7 Jun 2020 14:45:59 +0200 Subject: [PATCH] LibWeb: Open subframe links inside the subframe itself We now only delegate to the Web::PageView embedded when clicking links in the main frame. Links in subframes are handled internally. --- Libraries/LibWeb/Frame/EventHandler.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Libraries/LibWeb/Frame/EventHandler.cpp b/Libraries/LibWeb/Frame/EventHandler.cpp index c4d69ce7ef..c9c39ada0b 100644 --- a/Libraries/LibWeb/Frame/EventHandler.cpp +++ b/Libraries/LibWeb/Frame/EventHandler.cpp @@ -132,7 +132,12 @@ bool EventHandler::handle_mousedown(const Gfx::Point& position, unsigned button, if (href.starts_with("javascript:")) { document.run_javascript(href.substring_view(11, href.length() - 11)); } else { - page_view.notify_link_click({}, m_frame, link->href(), link->target(), modifiers); + if (m_frame.is_main_frame()) { + page_view.notify_link_click({}, m_frame, link->href(), link->target(), modifiers); + } else { + // FIXME: Handle different targets! + m_frame.loader().load(document.complete_url(link->href())); + } } } else if (button == GUI::MouseButton::Right) { page_view.notify_link_context_menu_request({}, m_frame, position, link->href(), link->target(), modifiers);