mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 06:32:26 +02:00
LibWeb: Add disallow further import maps steps to ESO
This commit is contained in:
committed by
Linus Groh
parent
794dc2e16b
commit
9afea1248f
@@ -293,6 +293,20 @@ bool EnvironmentSettingsObject::module_type_allowed(AK::String const& module_typ
|
||||
return true;
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#disallow-further-import-maps
|
||||
void EnvironmentSettingsObject::disallow_further_import_maps()
|
||||
{
|
||||
// 1. Let global be settingsObject's global object.
|
||||
auto& global = global_object();
|
||||
|
||||
// 2. If global does not implement Window, then return.
|
||||
if (!is<Window>(global))
|
||||
return;
|
||||
|
||||
// 3. Set global's import maps allowed to false.
|
||||
verify_cast<Window>(global).set_import_maps_allowed(false);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#incumbent-settings-object
|
||||
EnvironmentSettingsObject& incumbent_settings_object()
|
||||
{
|
||||
|
||||
@@ -113,6 +113,8 @@ struct EnvironmentSettingsObject
|
||||
|
||||
bool module_type_allowed(String const& module_type) const;
|
||||
|
||||
void disallow_further_import_maps();
|
||||
|
||||
protected:
|
||||
explicit EnvironmentSettingsObject(NonnullOwnPtr<JS::ExecutionContext>);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user