mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
LibWeb: Keep more of the navigation parameters in Document
This commit is contained in:
parent
42b8656db3
commit
e5f6d36616
Notes:
sideshowbarker
2024-07-17 08:38:37 +09:00
Author: https://github.com/awesomekling
Commit: e5f6d36616
2 changed files with 46 additions and 3 deletions
|
@ -216,16 +216,19 @@ JS::NonnullGCPtr<Document> Document::create_and_initialize(Type type, String con
|
||||||
// whose type is type,
|
// whose type is type,
|
||||||
// content type is contentType,
|
// content type is contentType,
|
||||||
// origin is navigationParams's origin,
|
// origin is navigationParams's origin,
|
||||||
// FIXME: policy container is navigationParams's policy container,
|
// policy container is navigationParams's policy container,
|
||||||
// FIXME: permissions policy is permissionsPolicy,
|
// FIXME: permissions policy is permissionsPolicy,
|
||||||
// FIXME: active sandboxing flag set is navigationParams's final sandboxing flag set,
|
// active sandboxing flag set is navigationParams's final sandboxing flag set,
|
||||||
// FIXME: and cross-origin opener policy is navigationParams's cross-origin opener policy,
|
// FIXME: and cross-origin opener policy is navigationParams's cross-origin opener policy,
|
||||||
// FIXME: load timing info is loadTimingInfo,
|
// FIXME: load timing info is loadTimingInfo,
|
||||||
// FIXME: and navigation id is navigationParams's id.
|
// and navigation id is navigationParams's id.
|
||||||
auto document = Document::create(*window);
|
auto document = Document::create(*window);
|
||||||
document->m_type = type;
|
document->m_type = type;
|
||||||
document->m_content_type = content_type;
|
document->m_content_type = content_type;
|
||||||
document->set_origin(navigation_params.origin);
|
document->set_origin(navigation_params.origin);
|
||||||
|
document->m_policy_container = navigation_params.policy_container;
|
||||||
|
document->m_active_sandboxing_flag_set = navigation_params.final_sandboxing_flag_set;
|
||||||
|
document->m_navigation_id = navigation_params.id;
|
||||||
|
|
||||||
document->m_window = window;
|
document->m_window = window;
|
||||||
window->set_associated_document(*document);
|
window->set_associated_document(*document);
|
||||||
|
@ -1962,4 +1965,24 @@ void Document::set_domain(String const& domain)
|
||||||
dbgln("(STUBBED) Document::set_domain(domain='{}')", domain);
|
dbgln("(STUBBED) Document::set_domain(domain='{}')", domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Document::set_navigation_id(Optional<AK::String> navigation_id)
|
||||||
|
{
|
||||||
|
m_navigation_id = move(navigation_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
Optional<String> Document::navigation_id() const
|
||||||
|
{
|
||||||
|
return m_navigation_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
HTML::SandboxingFlagSet Document::active_sandboxing_flag_set() const
|
||||||
|
{
|
||||||
|
return m_active_sandboxing_flag_set;
|
||||||
|
}
|
||||||
|
|
||||||
|
HTML::PolicyContainer Document::policy_container() const
|
||||||
|
{
|
||||||
|
return m_policy_container;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <LibWeb/HTML/HTMLScriptElement.h>
|
#include <LibWeb/HTML/HTMLScriptElement.h>
|
||||||
#include <LibWeb/HTML/History.h>
|
#include <LibWeb/HTML/History.h>
|
||||||
#include <LibWeb/HTML/Origin.h>
|
#include <LibWeb/HTML/Origin.h>
|
||||||
|
#include <LibWeb/HTML/SandboxingFlagSet.h>
|
||||||
#include <LibWeb/HTML/Scripting/Environments.h>
|
#include <LibWeb/HTML/Scripting/Environments.h>
|
||||||
#include <LibWeb/HTML/Window.h>
|
#include <LibWeb/HTML/Window.h>
|
||||||
|
|
||||||
|
@ -371,6 +372,16 @@ public:
|
||||||
// https://html.spec.whatwg.org/#completely-loaded
|
// https://html.spec.whatwg.org/#completely-loaded
|
||||||
bool is_completely_loaded() const;
|
bool is_completely_loaded() const;
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/dom.html#concept-document-navigation-id
|
||||||
|
Optional<String> navigation_id() const;
|
||||||
|
void set_navigation_id(Optional<String>);
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/origin.html#active-sandboxing-flag-set
|
||||||
|
HTML::SandboxingFlagSet active_sandboxing_flag_set() const;
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/dom.html#concept-document-policy-container
|
||||||
|
HTML::PolicyContainer policy_container() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void visit_edges(Cell::Visitor&) override;
|
virtual void visit_edges(Cell::Visitor&) override;
|
||||||
|
|
||||||
|
@ -506,6 +517,15 @@ private:
|
||||||
// https://html.spec.whatwg.org/#completely-loaded-time
|
// https://html.spec.whatwg.org/#completely-loaded-time
|
||||||
Optional<AK::Time> m_completely_loaded_time;
|
Optional<AK::Time> m_completely_loaded_time;
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/dom.html#concept-document-navigation-id
|
||||||
|
Optional<String> m_navigation_id;
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/origin.html#active-sandboxing-flag-set
|
||||||
|
HTML::SandboxingFlagSet m_active_sandboxing_flag_set;
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/dom.html#concept-document-policy-container
|
||||||
|
HTML::PolicyContainer m_policy_container;
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/interaction.html#visibility-state
|
// https://html.spec.whatwg.org/multipage/interaction.html#visibility-state
|
||||||
String m_visibility_state { "hidden" };
|
String m_visibility_state { "hidden" };
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue