1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 18:27:42 +00:00

LibWeb: Add navigable property in NavigationParams

This commit is contained in:
Aliaksandr Kalenik 2023-04-05 09:20:05 +03:00 committed by Andreas Kling
parent 0c919718ae
commit 38a2d5ead3
2 changed files with 6 additions and 0 deletions

View file

@ -11,6 +11,7 @@
#include <LibWeb/HTML/CrossOrigin/CrossOriginOpenerPolicy.h>
#include <LibWeb/HTML/CrossOrigin/CrossOriginOpenerPolicyEnforcementResult.h>
#include <LibWeb/HTML/HistoryHandlingBehavior.h>
#include <LibWeb/HTML/Navigable.h>
#include <LibWeb/HTML/Origin.h>
#include <LibWeb/HTML/PolicyContainers.h>
#include <LibWeb/HTML/SandboxingFlagSet.h>
@ -49,6 +50,9 @@ struct NavigationParams {
// the browsing context to be navigated (or discarded, if a browsing context group switch occurs)
JS::Handle<HTML::BrowsingContext> browsing_context;
// the navigable to be navigated
JS::Handle<Navigable> navigable;
// a history handling behavior
HistoryHandlingBehavior history_handling { HistoryHandlingBehavior::Default };

View file

@ -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);