From e80147afbacac1d6072143b5314f84e16289b497 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Wed, 9 Nov 2022 00:35:55 +0100 Subject: [PATCH] Ladybird: Fix reloading functionality Previously, reloading went back to the first page loaded by WebView::load() or WebView::load_html(), as they are the only methods that modify m_url, which is what the reload loaded. Now we handle reloads in Tab.cpp by simply loading the last entry in the m_history. --- Ladybird/Tab.cpp | 3 ++- Ladybird/WebContentView.cpp | 5 ----- Ladybird/WebContentView.h | 1 - 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Ladybird/Tab.cpp b/Ladybird/Tab.cpp index 27b40022fe..7bb6bda055 100644 --- a/Ladybird/Tab.cpp +++ b/Ladybird/Tab.cpp @@ -159,7 +159,8 @@ void Tab::home() void Tab::reload() { - view().reload(); + m_is_history_navigation = true; + view().load(m_history.current().url.to_string()); } void Tab::location_edit_return_pressed() diff --git a/Ladybird/WebContentView.cpp b/Ladybird/WebContentView.cpp index 2d6ab5c380..95a5abe442 100644 --- a/Ladybird/WebContentView.cpp +++ b/Ladybird/WebContentView.cpp @@ -79,11 +79,6 @@ WebContentView::~WebContentView() { } -void WebContentView::reload() -{ - load(m_url); -} - void WebContentView::load(AK::URL const& url) { m_url = url; diff --git a/Ladybird/WebContentView.h b/Ladybird/WebContentView.h index 3af84a76d1..9171af333a 100644 --- a/Ladybird/WebContentView.h +++ b/Ladybird/WebContentView.h @@ -53,7 +53,6 @@ public: void load(AK::URL const&); void load_html(StringView html, AK::URL const&); - void reload(); Function on_context_menu_request; Function on_link_click;