summaryrefslogtreecommitdiff
path: root/Ladybird
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2022-11-09 00:35:55 +0100
committerAndrew Kaster <andrewdkaster@gmail.com>2022-12-25 07:58:58 -0700
commite80147afbacac1d6072143b5314f84e16289b497 (patch)
treead5231d67c736ac00d1a3984011bbd27c449ecd3 /Ladybird
parent0b15fd4a121634075cfb95f8c46c92349077597c (diff)
downloadserenity-e80147afbacac1d6072143b5314f84e16289b497.zip
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.
Diffstat (limited to 'Ladybird')
-rw-r--r--Ladybird/Tab.cpp3
-rw-r--r--Ladybird/WebContentView.cpp5
-rw-r--r--Ladybird/WebContentView.h1
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<void(Gfx::IntPoint const& screen_position)> on_context_menu_request;
Function<void(const AK::URL&, String const& target, unsigned modifiers)> on_link_click;