mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb/HTML: Pass user_involvement through navigables code
This corresponds to part of https://github.com/whatwg/html/pull/10818
This commit is contained in:
parent
8b5e9c2a1d
commit
c6a18f795d
Notes:
github-actions[bot]
2025-01-11 10:11:59 +00:00
Author: https://github.com/AtkinsSJ
Commit: c6a18f795d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3171
7 changed files with 110 additions and 94 deletions
|
@ -18,7 +18,7 @@ bool can_load_document_with_type(MimeSniff::MimeType const&);
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/document-lifecycle.html#read-ua-inline
|
||||
template<typename MutateDocument>
|
||||
GC::Ref<DOM::Document> create_document_for_inline_content(GC::Ptr<HTML::Navigable> navigable, Optional<String> navigation_id, MutateDocument mutate_document)
|
||||
GC::Ref<DOM::Document> create_document_for_inline_content(GC::Ptr<HTML::Navigable> navigable, Optional<String> navigation_id, HTML::UserNavigationInvolvement user_involvement, MutateDocument mutate_document)
|
||||
{
|
||||
auto& vm = navigable->vm();
|
||||
|
||||
|
@ -53,6 +53,7 @@ GC::Ref<DOM::Document> create_document_for_inline_content(GC::Ptr<HTML::Navigabl
|
|||
// opener policy: coop
|
||||
// FIXME: navigation timing type: navTimingType
|
||||
// about base URL: null
|
||||
// user involvement: userInvolvement
|
||||
auto response = Fetch::Infrastructure::Response::create(vm);
|
||||
response->url_list().append(URL::URL("about:error")); // AD-HOC: https://github.com/whatwg/html/issues/9122
|
||||
auto navigation_params = vm.heap().allocate<HTML::NavigationParams>();
|
||||
|
@ -69,6 +70,7 @@ GC::Ref<DOM::Document> create_document_for_inline_content(GC::Ptr<HTML::Navigabl
|
|||
navigation_params->final_sandboxing_flag_set = HTML::SandboxingFlagSet {};
|
||||
navigation_params->opener_policy = move(coop);
|
||||
navigation_params->about_base_url = {};
|
||||
navigation_params->user_involvement = user_involvement;
|
||||
|
||||
// 5. Let document be the result of creating and initializing a Document object given "html", "text/html", and navigationParams.
|
||||
auto document = DOM::Document::create_and_initialize(DOM::Document::Type::HTML, "text/html"_string, navigation_params).release_value_but_fixme_should_propagate_errors();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue