mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +00:00
Everywhere: Use unqualified AK::URL
Now possible in LibWeb now that there is no longer a Web::URL.
This commit is contained in:
parent
f9e5b43b7a
commit
9ce8189f21
156 changed files with 471 additions and 471 deletions
|
@ -18,7 +18,7 @@ namespace Web::HTML {
|
|||
JS_DEFINE_ALLOCATOR(ClassicScript);
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#creating-a-classic-script
|
||||
JS::NonnullGCPtr<ClassicScript> ClassicScript::create(ByteString filename, StringView source, EnvironmentSettingsObject& environment_settings_object, AK::URL base_url, size_t source_line_number, MutedErrors muted_errors)
|
||||
JS::NonnullGCPtr<ClassicScript> ClassicScript::create(ByteString filename, StringView source, EnvironmentSettingsObject& environment_settings_object, URL base_url, size_t source_line_number, MutedErrors muted_errors)
|
||||
{
|
||||
auto& vm = environment_settings_object.realm().vm();
|
||||
|
||||
|
@ -147,7 +147,7 @@ JS::Completion ClassicScript::run(RethrowErrors rethrow_errors, JS::GCPtr<JS::En
|
|||
// Return Completion { [[Type]]: throw, [[Value]]: a new "QuotaExceededError" DOMException, [[Target]]: empty }.
|
||||
}
|
||||
|
||||
ClassicScript::ClassicScript(AK::URL base_url, ByteString filename, EnvironmentSettingsObject& environment_settings_object)
|
||||
ClassicScript::ClassicScript(URL base_url, ByteString filename, EnvironmentSettingsObject& environment_settings_object)
|
||||
: Script(move(base_url), move(filename), environment_settings_object)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
No,
|
||||
Yes,
|
||||
};
|
||||
static JS::NonnullGCPtr<ClassicScript> create(ByteString filename, StringView source, EnvironmentSettingsObject&, AK::URL base_url, size_t source_line_number = 1, MutedErrors = MutedErrors::No);
|
||||
static JS::NonnullGCPtr<ClassicScript> create(ByteString filename, StringView source, EnvironmentSettingsObject&, URL base_url, size_t source_line_number = 1, MutedErrors = MutedErrors::No);
|
||||
|
||||
JS::Script* script_record() { return m_script_record; }
|
||||
JS::Script const* script_record() const { return m_script_record; }
|
||||
|
@ -38,7 +38,7 @@ public:
|
|||
MutedErrors muted_errors() const { return m_muted_errors; }
|
||||
|
||||
private:
|
||||
ClassicScript(AK::URL base_url, ByteString filename, EnvironmentSettingsObject& environment_settings_object);
|
||||
ClassicScript(URL base_url, ByteString filename, EnvironmentSettingsObject& environment_settings_object);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ void EnvironmentSettingsObject::prepare_to_run_callback()
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#parse-a-url
|
||||
AK::URL EnvironmentSettingsObject::parse_url(StringView url)
|
||||
URL EnvironmentSettingsObject::parse_url(StringView url)
|
||||
{
|
||||
// 1. Let encoding be document's character encoding, if document was given, and environment settings object's API URL character encoding otherwise.
|
||||
// FIXME: Pass in environment settings object's API URL character encoding.
|
||||
|
|
|
@ -23,10 +23,10 @@ struct Environment {
|
|||
String id;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-creation-url
|
||||
AK::URL creation_url;
|
||||
URL creation_url;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-top-level-creation-url
|
||||
AK::URL top_level_creation_url;
|
||||
URL top_level_creation_url;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-top-level-origin
|
||||
Origin top_level_origin;
|
||||
|
@ -72,7 +72,7 @@ struct EnvironmentSettingsObject
|
|||
virtual String api_url_character_encoding() = 0;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url
|
||||
virtual AK::URL api_base_url() = 0;
|
||||
virtual URL api_base_url() = 0;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin
|
||||
virtual Origin origin() = 0;
|
||||
|
@ -83,7 +83,7 @@ struct EnvironmentSettingsObject
|
|||
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-cross-origin-isolated-capability
|
||||
virtual CanUseCrossOriginIsolatedAPIs cross_origin_isolated_capability() = 0;
|
||||
|
||||
AK::URL parse_url(StringView);
|
||||
URL parse_url(StringView);
|
||||
|
||||
JS::Realm& realm();
|
||||
JS::Object& global_object();
|
||||
|
|
|
@ -77,11 +77,11 @@ ByteString module_type_from_module_request(JS::ModuleRequest const& module_reque
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#resolve-a-module-specifier
|
||||
WebIDL::ExceptionOr<AK::URL> resolve_module_specifier(Optional<Script&> referring_script, ByteString const& specifier)
|
||||
WebIDL::ExceptionOr<URL> resolve_module_specifier(Optional<Script&> referring_script, ByteString const& specifier)
|
||||
{
|
||||
// 1. Let settingsObject and baseURL be null.
|
||||
Optional<EnvironmentSettingsObject&> settings_object;
|
||||
Optional<AK::URL const&> base_url;
|
||||
Optional<URL const&> base_url;
|
||||
|
||||
// 2. If referringScript is not null, then:
|
||||
if (referring_script.has_value()) {
|
||||
|
@ -153,7 +153,7 @@ WebIDL::ExceptionOr<AK::URL> resolve_module_specifier(Optional<Script&> referrin
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#resolving-an-imports-match
|
||||
WebIDL::ExceptionOr<Optional<AK::URL>> resolve_imports_match(ByteString const& normalized_specifier, Optional<AK::URL> as_url, ModuleSpecifierMap const& specifier_map)
|
||||
WebIDL::ExceptionOr<Optional<URL>> resolve_imports_match(ByteString const& normalized_specifier, Optional<URL> as_url, ModuleSpecifierMap const& specifier_map)
|
||||
{
|
||||
// 1. For each specifierKey → resolutionResult of specifierMap:
|
||||
for (auto const& [specifier_key, resolution_result] : specifier_map) {
|
||||
|
@ -216,11 +216,11 @@ WebIDL::ExceptionOr<Optional<AK::URL>> resolve_imports_match(ByteString const& n
|
|||
}
|
||||
|
||||
// 2. Return null.
|
||||
return Optional<AK::URL> {};
|
||||
return Optional<URL> {};
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#resolving-a-url-like-module-specifier
|
||||
Optional<AK::URL> resolve_url_like_module_specifier(ByteString const& specifier, AK::URL const& base_url)
|
||||
Optional<URL> resolve_url_like_module_specifier(ByteString const& specifier, URL const& base_url)
|
||||
{
|
||||
// 1. If specifier starts with "/", "./", or "../", then:
|
||||
if (specifier.starts_with("/"sv) || specifier.starts_with("./"sv) || specifier.starts_with("../"sv)) {
|
||||
|
@ -277,7 +277,7 @@ static void set_up_module_script_request(Fetch::Infrastructure::Request& request
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-classic-script
|
||||
WebIDL::ExceptionOr<void> fetch_classic_script(JS::NonnullGCPtr<HTMLScriptElement> element, AK::URL const& url, EnvironmentSettingsObject& settings_object, ScriptFetchOptions options, CORSSettingAttribute cors_setting, String character_encoding, OnFetchScriptComplete on_complete)
|
||||
WebIDL::ExceptionOr<void> fetch_classic_script(JS::NonnullGCPtr<HTMLScriptElement> element, URL const& url, EnvironmentSettingsObject& settings_object, ScriptFetchOptions options, CORSSettingAttribute cors_setting, String character_encoding, OnFetchScriptComplete on_complete)
|
||||
{
|
||||
auto& realm = element->realm();
|
||||
auto& vm = realm.vm();
|
||||
|
@ -342,7 +342,7 @@ WebIDL::ExceptionOr<void> fetch_classic_script(JS::NonnullGCPtr<HTMLScriptElemen
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-classic-worker-script
|
||||
WebIDL::ExceptionOr<void> fetch_classic_worker_script(AK::URL const& url, EnvironmentSettingsObject& fetch_client, Fetch::Infrastructure::Request::Destination destination, EnvironmentSettingsObject& settings_object, PerformTheFetchHook perform_fetch, OnFetchScriptComplete on_complete)
|
||||
WebIDL::ExceptionOr<void> fetch_classic_worker_script(URL const& url, EnvironmentSettingsObject& fetch_client, Fetch::Infrastructure::Request::Destination destination, EnvironmentSettingsObject& settings_object, PerformTheFetchHook perform_fetch, OnFetchScriptComplete on_complete)
|
||||
{
|
||||
auto& realm = settings_object.realm();
|
||||
auto& vm = realm.vm();
|
||||
|
@ -551,7 +551,7 @@ void fetch_descendants_of_a_module_script(JS::Realm& realm, JavaScriptModuleScri
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-single-module-script
|
||||
void fetch_single_module_script(JS::Realm& realm,
|
||||
AK::URL const& url,
|
||||
URL const& url,
|
||||
EnvironmentSettingsObject& fetch_client,
|
||||
Fetch::Infrastructure::Request::Destination destination,
|
||||
ScriptFetchOptions const& options,
|
||||
|
@ -666,7 +666,7 @@ void fetch_single_module_script(JS::Realm& realm,
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-module-script-tree
|
||||
void fetch_external_module_script_graph(JS::Realm& realm, AK::URL const& url, EnvironmentSettingsObject& settings_object, ScriptFetchOptions const& options, OnFetchScriptComplete on_complete)
|
||||
void fetch_external_module_script_graph(JS::Realm& realm, URL const& url, EnvironmentSettingsObject& settings_object, ScriptFetchOptions const& options, OnFetchScriptComplete on_complete)
|
||||
{
|
||||
// 1. Disallow further import maps given settingsObject.
|
||||
settings_object.disallow_further_import_maps();
|
||||
|
@ -688,7 +688,7 @@ void fetch_external_module_script_graph(JS::Realm& realm, AK::URL const& url, En
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#fetch-an-inline-module-script-graph
|
||||
void fetch_inline_module_script_graph(JS::Realm& realm, ByteString const& filename, ByteString const& source_text, AK::URL const& base_url, EnvironmentSettingsObject& settings_object, OnFetchScriptComplete on_complete)
|
||||
void fetch_inline_module_script_graph(JS::Realm& realm, ByteString const& filename, ByteString const& source_text, URL const& base_url, EnvironmentSettingsObject& settings_object, OnFetchScriptComplete on_complete)
|
||||
{
|
||||
// 1. Disallow further import maps given settingsObject.
|
||||
settings_object.disallow_further_import_maps();
|
||||
|
@ -708,7 +708,7 @@ void fetch_inline_module_script_graph(JS::Realm& realm, ByteString const& filena
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-single-imported-module-script
|
||||
void fetch_single_imported_module_script(JS::Realm& realm,
|
||||
AK::URL const& url,
|
||||
URL const& url,
|
||||
EnvironmentSettingsObject& fetch_client,
|
||||
Fetch::Infrastructure::Request::Destination destination,
|
||||
ScriptFetchOptions const& options,
|
||||
|
|
|
@ -82,16 +82,16 @@ private:
|
|||
};
|
||||
|
||||
ByteString module_type_from_module_request(JS::ModuleRequest const&);
|
||||
WebIDL::ExceptionOr<AK::URL> resolve_module_specifier(Optional<Script&> referring_script, ByteString const& specifier);
|
||||
WebIDL::ExceptionOr<Optional<AK::URL>> resolve_imports_match(ByteString const& normalized_specifier, Optional<AK::URL> as_url, ModuleSpecifierMap const&);
|
||||
Optional<AK::URL> resolve_url_like_module_specifier(ByteString const& specifier, AK::URL const& base_url);
|
||||
WebIDL::ExceptionOr<URL> resolve_module_specifier(Optional<Script&> referring_script, ByteString const& specifier);
|
||||
WebIDL::ExceptionOr<Optional<URL>> resolve_imports_match(ByteString const& normalized_specifier, Optional<URL> as_url, ModuleSpecifierMap const&);
|
||||
Optional<URL> resolve_url_like_module_specifier(ByteString const& specifier, URL const& base_url);
|
||||
|
||||
WebIDL::ExceptionOr<void> fetch_classic_script(JS::NonnullGCPtr<HTMLScriptElement>, AK::URL const&, EnvironmentSettingsObject& settings_object, ScriptFetchOptions options, CORSSettingAttribute cors_setting, String character_encoding, OnFetchScriptComplete on_complete);
|
||||
WebIDL::ExceptionOr<void> fetch_classic_worker_script(AK::URL const&, EnvironmentSettingsObject& fetch_client, Fetch::Infrastructure::Request::Destination, EnvironmentSettingsObject& settings_object, PerformTheFetchHook, OnFetchScriptComplete);
|
||||
WebIDL::ExceptionOr<void> fetch_classic_script(JS::NonnullGCPtr<HTMLScriptElement>, URL const&, EnvironmentSettingsObject& settings_object, ScriptFetchOptions options, CORSSettingAttribute cors_setting, String character_encoding, OnFetchScriptComplete on_complete);
|
||||
WebIDL::ExceptionOr<void> fetch_classic_worker_script(URL const&, EnvironmentSettingsObject& fetch_client, Fetch::Infrastructure::Request::Destination, EnvironmentSettingsObject& settings_object, PerformTheFetchHook, OnFetchScriptComplete);
|
||||
void fetch_internal_module_script_graph(JS::Realm&, JS::ModuleRequest const& module_request, EnvironmentSettingsObject& fetch_client_settings_object, Fetch::Infrastructure::Request::Destination, ScriptFetchOptions const&, Script& referring_script, HashTable<ModuleLocationTuple> const& visited_set, OnFetchScriptComplete on_complete);
|
||||
void fetch_external_module_script_graph(JS::Realm&, AK::URL const&, EnvironmentSettingsObject& settings_object, ScriptFetchOptions const&, OnFetchScriptComplete on_complete);
|
||||
void fetch_inline_module_script_graph(JS::Realm&, ByteString const& filename, ByteString const& source_text, AK::URL const& base_url, EnvironmentSettingsObject& settings_object, OnFetchScriptComplete on_complete);
|
||||
void fetch_single_imported_module_script(JS::Realm&, AK::URL const&, EnvironmentSettingsObject& fetch_client, Fetch::Infrastructure::Request::Destination, ScriptFetchOptions const&, EnvironmentSettingsObject& settings_object, Fetch::Infrastructure::Request::Referrer, JS::ModuleRequest const&, OnFetchScriptComplete on_complete);
|
||||
void fetch_external_module_script_graph(JS::Realm&, URL const&, EnvironmentSettingsObject& settings_object, ScriptFetchOptions const&, OnFetchScriptComplete on_complete);
|
||||
void fetch_inline_module_script_graph(JS::Realm&, ByteString const& filename, ByteString const& source_text, URL const& base_url, EnvironmentSettingsObject& settings_object, OnFetchScriptComplete on_complete);
|
||||
void fetch_single_imported_module_script(JS::Realm&, URL const&, EnvironmentSettingsObject& fetch_client, Fetch::Infrastructure::Request::Destination, ScriptFetchOptions const&, EnvironmentSettingsObject& settings_object, Fetch::Infrastructure::Request::Referrer, JS::ModuleRequest const&, OnFetchScriptComplete on_complete);
|
||||
|
||||
void fetch_descendants_of_a_module_script(JS::Realm&, JavaScriptModuleScript& module_script, EnvironmentSettingsObject& fetch_client_settings_object, Fetch::Infrastructure::Request::Destination, HashTable<ModuleLocationTuple> visited_set, OnFetchScriptComplete callback);
|
||||
void fetch_descendants_of_and_link_a_module_script(JS::Realm&, JavaScriptModuleScript&, EnvironmentSettingsObject&, Fetch::Infrastructure::Request::Destination, OnFetchScriptComplete on_complete);
|
||||
|
@ -101,6 +101,6 @@ enum class TopLevelModule {
|
|||
No
|
||||
};
|
||||
|
||||
void fetch_single_module_script(JS::Realm&, AK::URL const&, EnvironmentSettingsObject& fetch_client, Fetch::Infrastructure::Request::Destination, ScriptFetchOptions const&, EnvironmentSettingsObject& settings_object, Web::Fetch::Infrastructure::Request::ReferrerType const&, Optional<JS::ModuleRequest> const&, TopLevelModule, OnFetchScriptComplete callback);
|
||||
void fetch_single_module_script(JS::Realm&, URL const&, EnvironmentSettingsObject& fetch_client, Fetch::Infrastructure::Request::Destination, ScriptFetchOptions const&, EnvironmentSettingsObject& settings_object, Web::Fetch::Infrastructure::Request::ReferrerType const&, Optional<JS::ModuleRequest> const&, TopLevelModule, OnFetchScriptComplete callback);
|
||||
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
namespace Web::HTML {
|
||||
|
||||
using ModuleSpecifierMap = HashMap<ByteString, Optional<AK::URL>>;
|
||||
using ModuleSpecifierMap = HashMap<ByteString, Optional<URL>>;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#import-map
|
||||
class ImportMap {
|
||||
|
@ -20,12 +20,12 @@ public:
|
|||
ModuleSpecifierMap const& imports() const { return m_imports; }
|
||||
ModuleSpecifierMap& imports() { return m_imports; }
|
||||
|
||||
HashMap<AK::URL, ModuleSpecifierMap> const& scopes() const { return m_scopes; }
|
||||
HashMap<AK::URL, ModuleSpecifierMap>& scopes() { return m_scopes; }
|
||||
HashMap<URL, ModuleSpecifierMap> const& scopes() const { return m_scopes; }
|
||||
HashMap<URL, ModuleSpecifierMap>& scopes() { return m_scopes; }
|
||||
|
||||
private:
|
||||
ModuleSpecifierMap m_imports;
|
||||
HashMap<AK::URL, ModuleSpecifierMap> m_scopes;
|
||||
HashMap<URL, ModuleSpecifierMap> m_scopes;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -21,17 +21,17 @@ void ModuleMap::visit_edges(Visitor& visitor)
|
|||
visitor.visit(callback);
|
||||
}
|
||||
|
||||
bool ModuleMap::is_fetching(AK::URL const& url, ByteString const& type) const
|
||||
bool ModuleMap::is_fetching(URL const& url, ByteString const& type) const
|
||||
{
|
||||
return is(url, type, EntryType::Fetching);
|
||||
}
|
||||
|
||||
bool ModuleMap::is_failed(AK::URL const& url, ByteString const& type) const
|
||||
bool ModuleMap::is_failed(URL const& url, ByteString const& type) const
|
||||
{
|
||||
return is(url, type, EntryType::Failed);
|
||||
}
|
||||
|
||||
bool ModuleMap::is(AK::URL const& url, ByteString const& type, EntryType entry_type) const
|
||||
bool ModuleMap::is(URL const& url, ByteString const& type, EntryType entry_type) const
|
||||
{
|
||||
auto value = m_values.get({ url, type });
|
||||
if (!value.has_value())
|
||||
|
@ -40,12 +40,12 @@ bool ModuleMap::is(AK::URL const& url, ByteString const& type, EntryType entry_t
|
|||
return value->type == entry_type;
|
||||
}
|
||||
|
||||
Optional<ModuleMap::Entry> ModuleMap::get(AK::URL const& url, ByteString const& type) const
|
||||
Optional<ModuleMap::Entry> ModuleMap::get(URL const& url, ByteString const& type) const
|
||||
{
|
||||
return m_values.get({ url, type });
|
||||
}
|
||||
|
||||
AK::HashSetResult ModuleMap::set(AK::URL const& url, ByteString const& type, Entry entry)
|
||||
AK::HashSetResult ModuleMap::set(URL const& url, ByteString const& type, Entry entry)
|
||||
{
|
||||
// NOTE: Re-entering this function while firing wait_for_change callbacks is not allowed.
|
||||
VERIFY(!m_firing_callbacks);
|
||||
|
@ -63,7 +63,7 @@ AK::HashSetResult ModuleMap::set(AK::URL const& url, ByteString const& type, Ent
|
|||
return value;
|
||||
}
|
||||
|
||||
void ModuleMap::wait_for_change(JS::Heap& heap, AK::URL const& url, ByteString const& type, Function<void(Entry)> callback)
|
||||
void ModuleMap::wait_for_change(JS::Heap& heap, URL const& url, ByteString const& type, Function<void(Entry)> callback)
|
||||
{
|
||||
m_callbacks.ensure({ url, type }).append(JS::create_heap_function(heap, move(callback)));
|
||||
}
|
||||
|
|
|
@ -15,13 +15,13 @@ namespace Web::HTML {
|
|||
|
||||
class ModuleLocationTuple {
|
||||
public:
|
||||
ModuleLocationTuple(AK::URL url, ByteString type)
|
||||
ModuleLocationTuple(URL url, ByteString type)
|
||||
: m_url(move(url))
|
||||
, m_type(move(type))
|
||||
{
|
||||
}
|
||||
|
||||
AK::URL const& url() const { return m_url; }
|
||||
URL const& url() const { return m_url; }
|
||||
ByteString const& type() const { return m_type; }
|
||||
|
||||
bool operator==(ModuleLocationTuple const& other) const
|
||||
|
@ -30,7 +30,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
AK::URL m_url;
|
||||
URL m_url;
|
||||
ByteString m_type;
|
||||
};
|
||||
|
||||
|
@ -56,16 +56,16 @@ public:
|
|||
|
||||
using CallbackFunction = JS::NonnullGCPtr<JS::HeapFunction<void(Entry)>>;
|
||||
|
||||
bool is_fetching(AK::URL const& url, ByteString const& type) const;
|
||||
bool is_failed(AK::URL const& url, ByteString const& type) const;
|
||||
bool is_fetching(URL const& url, ByteString const& type) const;
|
||||
bool is_failed(URL const& url, ByteString const& type) const;
|
||||
|
||||
bool is(AK::URL const& url, ByteString const& type, EntryType) const;
|
||||
bool is(URL const& url, ByteString const& type, EntryType) const;
|
||||
|
||||
Optional<Entry> get(AK::URL const& url, ByteString const& type) const;
|
||||
Optional<Entry> get(URL const& url, ByteString const& type) const;
|
||||
|
||||
AK::HashSetResult set(AK::URL const& url, ByteString const& type, Entry);
|
||||
AK::HashSetResult set(URL const& url, ByteString const& type, Entry);
|
||||
|
||||
void wait_for_change(JS::Heap&, AK::URL const& url, ByteString const& type, Function<void(Entry)> callback);
|
||||
void wait_for_change(JS::Heap&, URL const& url, ByteString const& type, Function<void(Entry)> callback);
|
||||
|
||||
private:
|
||||
virtual void visit_edges(JS::Cell::Visitor&) override;
|
||||
|
|
|
@ -17,20 +17,20 @@ JS_DEFINE_ALLOCATOR(JavaScriptModuleScript);
|
|||
|
||||
ModuleScript::~ModuleScript() = default;
|
||||
|
||||
ModuleScript::ModuleScript(AK::URL base_url, ByteString filename, EnvironmentSettingsObject& environment_settings_object)
|
||||
ModuleScript::ModuleScript(URL base_url, ByteString filename, EnvironmentSettingsObject& environment_settings_object)
|
||||
: Script(move(base_url), move(filename), environment_settings_object)
|
||||
{
|
||||
}
|
||||
|
||||
JavaScriptModuleScript::~JavaScriptModuleScript() = default;
|
||||
|
||||
JavaScriptModuleScript::JavaScriptModuleScript(AK::URL base_url, ByteString filename, EnvironmentSettingsObject& environment_settings_object)
|
||||
JavaScriptModuleScript::JavaScriptModuleScript(URL base_url, ByteString filename, EnvironmentSettingsObject& environment_settings_object)
|
||||
: ModuleScript(move(base_url), move(filename), environment_settings_object)
|
||||
{
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#creating-a-javascript-module-script
|
||||
WebIDL::ExceptionOr<JS::GCPtr<JavaScriptModuleScript>> JavaScriptModuleScript::create(ByteString const& filename, StringView source, EnvironmentSettingsObject& settings_object, AK::URL base_url)
|
||||
WebIDL::ExceptionOr<JS::GCPtr<JavaScriptModuleScript>> JavaScriptModuleScript::create(ByteString const& filename, StringView source, EnvironmentSettingsObject& settings_object, URL base_url)
|
||||
{
|
||||
// 1. If scripting is disabled for settings, then set source to the empty string.
|
||||
if (settings_object.is_scripting_disabled())
|
||||
|
|
|
@ -19,7 +19,7 @@ public:
|
|||
virtual ~ModuleScript() override;
|
||||
|
||||
protected:
|
||||
ModuleScript(AK::URL base_url, ByteString filename, EnvironmentSettingsObject& environment_settings_object);
|
||||
ModuleScript(URL base_url, ByteString filename, EnvironmentSettingsObject& environment_settings_object);
|
||||
};
|
||||
|
||||
class JavaScriptModuleScript final : public ModuleScript {
|
||||
|
@ -29,7 +29,7 @@ class JavaScriptModuleScript final : public ModuleScript {
|
|||
public:
|
||||
virtual ~JavaScriptModuleScript() override;
|
||||
|
||||
static WebIDL::ExceptionOr<JS::GCPtr<JavaScriptModuleScript>> create(ByteString const& filename, StringView source, EnvironmentSettingsObject&, AK::URL base_url);
|
||||
static WebIDL::ExceptionOr<JS::GCPtr<JavaScriptModuleScript>> create(ByteString const& filename, StringView source, EnvironmentSettingsObject&, URL base_url);
|
||||
|
||||
enum class PreventErrorReporting {
|
||||
Yes,
|
||||
|
@ -42,7 +42,7 @@ public:
|
|||
JS::SourceTextModule* record() { return m_record.ptr(); }
|
||||
|
||||
protected:
|
||||
JavaScriptModuleScript(AK::URL base_url, ByteString filename, EnvironmentSettingsObject& environment_settings_object);
|
||||
JavaScriptModuleScript(URL base_url, ByteString filename, EnvironmentSettingsObject& environment_settings_object);
|
||||
|
||||
private:
|
||||
virtual void visit_edges(JS::Cell::Visitor&) override;
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Web::HTML {
|
|||
|
||||
JS_DEFINE_ALLOCATOR(Script);
|
||||
|
||||
Script::Script(AK::URL base_url, ByteString filename, EnvironmentSettingsObject& environment_settings_object)
|
||||
Script::Script(URL base_url, ByteString filename, EnvironmentSettingsObject& environment_settings_object)
|
||||
: m_base_url(move(base_url))
|
||||
, m_filename(move(filename))
|
||||
, m_settings_object(environment_settings_object)
|
||||
|
|
|
@ -23,7 +23,7 @@ class Script
|
|||
public:
|
||||
virtual ~Script() override;
|
||||
|
||||
AK::URL const& base_url() const { return m_base_url; }
|
||||
URL const& base_url() const { return m_base_url; }
|
||||
ByteString const& filename() const { return m_filename; }
|
||||
|
||||
EnvironmentSettingsObject& settings_object() { return m_settings_object; }
|
||||
|
@ -35,14 +35,14 @@ public:
|
|||
void set_parse_error(JS::Value value) { m_parse_error = value; }
|
||||
|
||||
protected:
|
||||
Script(AK::URL base_url, ByteString filename, EnvironmentSettingsObject& environment_settings_object);
|
||||
Script(URL base_url, ByteString filename, EnvironmentSettingsObject& environment_settings_object);
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
private:
|
||||
virtual void visit_host_defined_self(JS::Cell::Visitor&) override;
|
||||
|
||||
AK::URL m_base_url;
|
||||
URL m_base_url;
|
||||
ByteString m_filename;
|
||||
JS::NonnullGCPtr<EnvironmentSettingsObject> m_settings_object;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ void WindowEnvironmentSettingsObject::visit_edges(JS::Cell::Visitor& visitor)
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/window-object.html#set-up-a-window-environment-settings-object
|
||||
void WindowEnvironmentSettingsObject::setup(Page& page, AK::URL const& creation_url, NonnullOwnPtr<JS::ExecutionContext> execution_context, Optional<Environment> reserved_environment, AK::URL top_level_creation_url, Origin top_level_origin)
|
||||
void WindowEnvironmentSettingsObject::setup(Page& page, URL const& creation_url, NonnullOwnPtr<JS::ExecutionContext> execution_context, Optional<Environment> reserved_environment, URL top_level_creation_url, Origin top_level_origin)
|
||||
{
|
||||
// 1. Let realm be the value of execution context's Realm component.
|
||||
auto realm = execution_context->realm;
|
||||
|
@ -97,7 +97,7 @@ String WindowEnvironmentSettingsObject::api_url_character_encoding()
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/window-object.html#script-settings-for-window-objects:api-base-url
|
||||
AK::URL WindowEnvironmentSettingsObject::api_base_url()
|
||||
URL WindowEnvironmentSettingsObject::api_base_url()
|
||||
{
|
||||
// Return the current base URL of window's associated Document.
|
||||
return m_window->associated_document().base_url();
|
||||
|
|
|
@ -16,13 +16,13 @@ class WindowEnvironmentSettingsObject final : public EnvironmentSettingsObject {
|
|||
JS_DECLARE_ALLOCATOR(WindowEnvironmentSettingsObject);
|
||||
|
||||
public:
|
||||
static void setup(Page&, AK::URL const& creation_url, NonnullOwnPtr<JS::ExecutionContext>, Optional<Environment>, AK::URL top_level_creation_url, Origin top_level_origin);
|
||||
static void setup(Page&, URL const& creation_url, NonnullOwnPtr<JS::ExecutionContext>, Optional<Environment>, URL top_level_creation_url, Origin top_level_origin);
|
||||
|
||||
virtual ~WindowEnvironmentSettingsObject() override;
|
||||
|
||||
virtual JS::GCPtr<DOM::Document> responsible_document() override;
|
||||
virtual String api_url_character_encoding() override;
|
||||
virtual AK::URL api_base_url() override;
|
||||
virtual URL api_base_url() override;
|
||||
virtual Origin origin() override;
|
||||
virtual PolicyContainer policy_container() override;
|
||||
virtual CanUseCrossOriginIsolatedAPIs cross_origin_isolated_capability() override;
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
|
||||
JS::GCPtr<DOM::Document> responsible_document() override { return nullptr; }
|
||||
String api_url_character_encoding() override { return m_api_url_character_encoding; }
|
||||
AK::URL api_base_url() override { return m_url; }
|
||||
URL api_base_url() override { return m_url; }
|
||||
Origin origin() override { return m_origin; }
|
||||
PolicyContainer policy_container() override { return m_policy_container; }
|
||||
CanUseCrossOriginIsolatedAPIs cross_origin_isolated_capability() override { return CanUseCrossOriginIsolatedAPIs::No; }
|
||||
|
@ -39,7 +39,7 @@ private:
|
|||
virtual void visit_edges(JS::Cell::Visitor&) override;
|
||||
|
||||
String m_api_url_character_encoding;
|
||||
AK::URL m_url;
|
||||
URL m_url;
|
||||
HTML::Origin m_origin;
|
||||
HTML::PolicyContainer m_policy_container;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue