From 794dc2e16bd79a15ea9d17f145eab445d6181150 Mon Sep 17 00:00:00 2001 From: networkException Date: Sun, 23 Oct 2022 04:05:46 +0200 Subject: [PATCH] LibWeb: Expose an import map and import maps allowed on Window --- Userland/Libraries/LibWeb/HTML/Window.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Userland/Libraries/LibWeb/HTML/Window.h b/Userland/Libraries/LibWeb/HTML/Window.h index ec6f46d0e5..d34763d39c 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.h +++ b/Userland/Libraries/LibWeb/HTML/Window.h @@ -19,6 +19,7 @@ #include #include #include +#include #include namespace Web::HTML { @@ -55,6 +56,11 @@ public: JS::ThrowCompletionOr document_tree_child_browsing_context_count() const; + ImportMap const& import_map() const { return m_import_map; } + + bool import_maps_allowed() const { return m_import_maps_allowed; } + void set_import_maps_allowed(bool import_maps_allowed) { m_import_maps_allowed = import_maps_allowed; } + void alert_impl(String const&); bool confirm_impl(String const&); String prompt_impl(String const&, String const&); @@ -152,6 +158,12 @@ private: IDAllocator m_timer_id_allocator; HashMap> m_timers; + // https://html.spec.whatwg.org/multipage/webappapis.html#concept-window-import-map + ImportMap m_import_map; + + // https://html.spec.whatwg.org/multipage/webappapis.html#import-maps-allowed + bool m_import_maps_allowed { true }; + JS::GCPtr m_performance; JS::GCPtr m_crypto; JS::GCPtr m_screen;