From 38a2d5ead3fdd42aeb24f80831044ad64a5c7b9b Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Wed, 5 Apr 2023 09:20:05 +0300 Subject: [PATCH] LibWeb: Add navigable property in NavigationParams --- Userland/Libraries/LibWeb/HTML/NavigationParams.h | 4 ++++ Userland/Libraries/LibWeb/Loader/FrameLoader.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Userland/Libraries/LibWeb/HTML/NavigationParams.h b/Userland/Libraries/LibWeb/HTML/NavigationParams.h index dfda9b4259..1ff6143e36 100644 --- a/Userland/Libraries/LibWeb/HTML/NavigationParams.h +++ b/Userland/Libraries/LibWeb/HTML/NavigationParams.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -49,6 +50,9 @@ struct NavigationParams { // the browsing context to be navigated (or discarded, if a browsing context group switch occurs) JS::Handle browsing_context; + // the navigable to be navigated + JS::Handle navigable; + // a history handling behavior HistoryHandlingBehavior history_handling { HistoryHandlingBehavior::Default }; diff --git a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp index 23ecd39cd8..466aa0a036 100644 --- a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp +++ b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp @@ -338,6 +338,7 @@ void FrameLoader::load_html(StringView html, const AK::URL& url) .coop_enforcement_result = HTML::CrossOriginOpenerPolicyEnforcementResult {}, .reserved_environment = {}, .browsing_context = browsing_context(), + .navigable = nullptr, }; auto document = DOM::Document::create_and_initialize(DOM::Document::Type::HTML, "text/html", move(navigation_params)).release_value_but_fixme_should_propagate_errors(); browsing_context().set_active_document(document); @@ -463,6 +464,7 @@ void FrameLoader::resource_did_load() .coop_enforcement_result = HTML::CrossOriginOpenerPolicyEnforcementResult {}, .reserved_environment = {}, .browsing_context = browsing_context(), + .navigable = nullptr, }; auto document = DOM::Document::create_and_initialize(DOM::Document::Type::HTML, "text/html", move(navigation_params)).release_value_but_fixme_should_propagate_errors(); document->set_url(url);