1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:57:43 +00:00

LibWeb: Expose an import map and import maps allowed on Window

This commit is contained in:
networkException 2022-10-23 04:05:46 +02:00 committed by Linus Groh
parent d7947995d9
commit 794dc2e16b

View file

@ -19,6 +19,7 @@
#include <LibWeb/HTML/AnimationFrameCallbackDriver.h>
#include <LibWeb/HTML/CrossOrigin/CrossOriginPropertyDescriptorMap.h>
#include <LibWeb/HTML/GlobalEventHandlers.h>
#include <LibWeb/HTML/Scripting/ImportMap.h>
#include <LibWeb/HTML/WindowEventHandlers.h>
namespace Web::HTML {
@ -55,6 +56,11 @@ public:
JS::ThrowCompletionOr<size_t> 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<int, JS::NonnullGCPtr<Timer>> 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<HighResolutionTime::Performance> m_performance;
JS::GCPtr<Crypto::Crypto> m_crypto;
JS::GCPtr<CSS::Screen> m_screen;