diff options
author | Andreas Kling <kling@serenityos.org> | 2022-09-19 17:44:37 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-09-20 10:32:13 +0200 |
commit | e5f6d36616275f2dd69fb8893478df13a93d4bde (patch) | |
tree | e6feee7b717fc7de12f982e4fe97441942c3e5ea /Userland/Libraries/LibWeb | |
parent | 42b8656db34d795b8153689481c3858bcf328fb2 (diff) | |
download | serenity-e5f6d36616275f2dd69fb8893478df13a93d4bde.zip |
LibWeb: Keep more of the navigation parameters in Document
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Document.cpp | 29 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Document.h | 20 |
2 files changed, 46 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 3ae99605a0..35b6444e34 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -216,16 +216,19 @@ JS::NonnullGCPtr<Document> Document::create_and_initialize(Type type, String con // whose type is type, // content type is contentType, // 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: 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: 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); document->m_type = type; document->m_content_type = content_type; 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; window->set_associated_document(*document); @@ -1962,4 +1965,24 @@ void Document::set_domain(String const& 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; +} + } diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h index 7b280fb2e2..8be46b9dc1 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.h +++ b/Userland/Libraries/LibWeb/DOM/Document.h @@ -29,6 +29,7 @@ #include <LibWeb/HTML/HTMLScriptElement.h> #include <LibWeb/HTML/History.h> #include <LibWeb/HTML/Origin.h> +#include <LibWeb/HTML/SandboxingFlagSet.h> #include <LibWeb/HTML/Scripting/Environments.h> #include <LibWeb/HTML/Window.h> @@ -371,6 +372,16 @@ public: // https://html.spec.whatwg.org/#completely-loaded 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: virtual void visit_edges(Cell::Visitor&) override; @@ -506,6 +517,15 @@ private: // https://html.spec.whatwg.org/#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 String m_visibility_state { "hidden" }; }; |