From efefd44a9f0500a651b6d158b33b020474106001 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Mon, 15 Apr 2024 04:22:03 +0200 Subject: [PATCH] LibWeb: Navigate to changed url in Location::set_hash() This step assumes copyURL is modified in place, while `URL::Parser::basic_parse()` returns it as a result. > 6. Basic URL parse input, with copyURL as url and fragment state as state override. So copyURL has to be reassigned to navigate to new url on step 8: > 8. Location-object navigate this to copyURL. --- Userland/Libraries/LibWeb/HTML/Location.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/Location.cpp b/Userland/Libraries/LibWeb/HTML/Location.cpp index 0f258f46c1c..845a3d6d7b4 100644 --- a/Userland/Libraries/LibWeb/HTML/Location.cpp +++ b/Userland/Libraries/LibWeb/HTML/Location.cpp @@ -336,7 +336,7 @@ WebIDL::ExceptionOr Location::set_hash(String const& value) copy_url.set_fragment(String {}); // 6. Basic URL parse input, with copyURL as url and fragment state as state override. - auto result_url = URL::Parser::basic_parse(input, {}, copy_url, URL::Parser::State::Fragment); + copy_url = URL::Parser::basic_parse(input, {}, copy_url, URL::Parser::State::Fragment); // 7. If copyURL's fragment is this's url's fragment, then return. if (copy_url.fragment() == this->url().fragment())