From 9e223f6daeb3969d3997084a973b26daff6b4f7e Mon Sep 17 00:00:00 2001 From: mobounya Date: Tue, 16 Jul 2024 19:31:31 +0100 Subject: [PATCH] LibWeb: Add fetch group from the fetch spec Add fetch group concept from the '2.4. Fetch groups' in the fetch specs to the environment settings object. --- Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp | 2 ++ Userland/Libraries/LibWeb/HTML/Scripting/Environments.h | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp b/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp index 6deb6b35090..3b2a5c42f66 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp +++ b/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -54,6 +55,7 @@ void EnvironmentSettingsObject::visit_edges(Cell::Visitor& visitor) visitor.visit(m_module_map); visitor.ignore(m_outstanding_rejected_promises_weak_set); m_realm_execution_context->visit_edges(visitor); + visitor.visit(m_fetch_group); } JS::ExecutionContext& EnvironmentSettingsObject::realm_execution_context() diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/Environments.h b/Userland/Libraries/LibWeb/HTML/Scripting/Environments.h index db2ca9e729e..9e406fc3fb4 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/Environments.h +++ b/Userland/Libraries/LibWeb/HTML/Scripting/Environments.h @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -89,6 +90,7 @@ public: JS::Realm& realm(); JS::Object& global_object(); EventLoop& responsible_event_loop(); + Vector>& fetch_group() { return m_fetch_group; } RunScriptDecision can_run_script(); void prepare_to_run_script(); @@ -135,6 +137,10 @@ private: // https://html.spec.whatwg.org/multipage/webappapis.html#about-to-be-notified-rejected-promises-list Vector> m_about_to_be_notified_rejected_promises_list; + + // https://fetch.spec.whatwg.org/#concept-fetch-record + // A fetch group holds an ordered list of fetch records + Vector> m_fetch_group; }; EnvironmentSettingsObject& incumbent_settings_object();