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
|
@ -460,15 +460,16 @@ GC::Ptr<DOM::Document> load_document(HTML::NavigationParams const& navigation_pa
|
|||
if (type.essence() == "application/pdf"_string
|
||||
|| type.essence() == "text/pdf"_string) {
|
||||
// FIXME: If the user agent's PDF viewer supported is true, return the result of creating a document for inline
|
||||
// content that doesn't have a DOM given navigationParams's navigable.
|
||||
// content that doesn't have a DOM given navigationParams's navigable, navigationParams's id,
|
||||
// navigationParams's navigation timing type, and navigationParams's user involvement.
|
||||
}
|
||||
|
||||
// Otherwise, proceed onward.
|
||||
|
||||
// 3. If, given type, the new resource is to be handled by displaying some sort of inline content, e.g., a
|
||||
// FIXME: 3. If, given type, the new resource is to be handled by displaying some sort of inline content, e.g., a
|
||||
// native rendering of the content or an error message because the specified type is not supported, then
|
||||
// return the result of creating a document for inline content that doesn't have a DOM given navigationParams's
|
||||
// navigable, navigationParams's id, and navigationParams's navigation timing type.
|
||||
// navigable, navigationParams's id, navigationParams's navigation timing type, and navigationParams's user involvement.
|
||||
|
||||
// FIXME: 4. Otherwise, the document's type is such that the resource will not affect navigationParams's navigable,
|
||||
// e.g., because the resource is to be handed to an external application or because it is an unknown type
|
||||
|
|
|
@ -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