mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWeb: Give NavigationParams a constructor
This allows for NavigationParams to hold non-default constructable types.
This commit is contained in:
parent
766cbf4937
commit
0d905b1846
Notes:
github-actions[bot]
2025-06-17 18:55:41 +00:00
Author: https://github.com/shannonbooth
Commit: 0d905b1846
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5094
Reviewed-by: https://github.com/gmta ✅
4 changed files with 107 additions and 66 deletions
|
@ -37,13 +37,20 @@ ErrorOr<GC::Ref<SVGDecodedImageData>> SVGDecodedImageData::create(JS::Realm& rea
|
|||
GC::Ref<HTML::Navigable> navigable = page->top_level_traversable();
|
||||
auto response = Fetch::Infrastructure::Response::create(navigable->vm());
|
||||
response->url_list().append(url);
|
||||
auto navigation_params = navigable->heap().allocate<HTML::NavigationParams>();
|
||||
navigation_params->navigable = navigable;
|
||||
navigation_params->response = response;
|
||||
navigation_params->origin = URL::Origin {};
|
||||
navigation_params->policy_container = navigable->heap().allocate<HTML::PolicyContainer>(realm.heap());
|
||||
navigation_params->final_sandboxing_flag_set = HTML::SandboxingFlagSet {};
|
||||
navigation_params->opener_policy = HTML::OpenerPolicy {};
|
||||
auto navigation_params = navigable->heap().allocate<HTML::NavigationParams>(OptionalNone {},
|
||||
navigable,
|
||||
nullptr,
|
||||
response,
|
||||
nullptr,
|
||||
nullptr,
|
||||
HTML::OpenerPolicyEnforcementResult {},
|
||||
nullptr,
|
||||
URL::Origin {},
|
||||
navigable->heap().allocate<HTML::PolicyContainer>(realm.heap()),
|
||||
HTML::SandboxingFlagSet {},
|
||||
HTML::OpenerPolicy {},
|
||||
OptionalNone {},
|
||||
HTML::UserNavigationInvolvement::None);
|
||||
|
||||
// FIXME: Use Navigable::navigate() instead of manually replacing the navigable's document.
|
||||
auto document = MUST(DOM::Document::create_and_initialize(DOM::Document::Type::HTML, "text/html"_string, navigation_params));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue