From f1cab5de7a071fe76eae10d36603f6cf34fa989e Mon Sep 17 00:00:00 2001 From: sin-ack Date: Sun, 13 Oct 2024 00:43:13 +0000 Subject: [PATCH] LibWeb: Compare navigable active_url with fragments included This was previously negated due to a misread of https://url.spec.whatwg.org/#concept-url-equals. This change fixes a bunch of WPT crashes such as "/html/browsers/history/the-history-interface/001". --- Userland/Libraries/LibWeb/HTML/Navigable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/Navigable.cpp b/Userland/Libraries/LibWeb/HTML/Navigable.cpp index 603419ac9e5..e6f00bd5358 100644 --- a/Userland/Libraries/LibWeb/HTML/Navigable.cpp +++ b/Userland/Libraries/LibWeb/HTML/Navigable.cpp @@ -1289,7 +1289,7 @@ WebIDL::ExceptionOr Navigable::navigate(NavigateParams params) // 1. If url equals navigable's active document's URL, // and initiatorOriginSnapshot is same origin with targetNavigable's active document's origin, // then set historyHandling to "replace". - if (url.equals(active_document.url(), URL::ExcludeFragment::Yes) && initiator_origin_snapshot.is_same_origin(active_document.origin())) + if (url == active_document.url() && initiator_origin_snapshot.is_same_origin(active_document.origin())) history_handling = Bindings::NavigationHistoryBehavior::Replace; // 2. Otherwise, set historyHandling to "push".