AK+LibURL: Move AK::URL into a new URL library

This URL library ends up being a relatively fundamental base library of
the system, as LibCore depends on LibURL.

This change has two main benefits:
 * Moving AK back more towards being an agnostic library that can
   be used between the kernel and userspace. URL has never really fit
   that description - and is not used in the kernel.
 * URL _should_ depend on LibUnicode, as it needs punnycode support.
   However, it's not really possible to do this inside of AK as it can't
   depend on any external library. This change brings us a little closer
   to being able to do that, but unfortunately we aren't there quite
   yet, as the code generators depend on LibCore.
This commit is contained in:
Shannon Booth
2024-03-18 16:22:27 +13:00
committed by Tim Flynn
parent 21bfa001b1
commit e800605ad3
403 changed files with 1336 additions and 1305 deletions

View File

@@ -7,8 +7,8 @@
#pragma once
#include <AK/URL.h>
#include <LibJS/Forward.h>
#include <LibURL/URL.h>
#include <LibWeb/HTML/EventLoop/EventLoop.h>
#include <LibWeb/HTML/Origin.h>
#include <LibWeb/HTML/Scripting/ModuleMap.h>
@@ -24,10 +24,10 @@ struct Environment {
String id;
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-creation-url
URL creation_url;
URL::URL creation_url;
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-top-level-creation-url
URL top_level_creation_url;
URL::URL top_level_creation_url;
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-top-level-origin
Origin top_level_origin;
@@ -68,7 +68,7 @@ struct EnvironmentSettingsObject
virtual String api_url_character_encoding() = 0;
// https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url
virtual URL api_base_url() = 0;
virtual URL::URL api_base_url() = 0;
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin
virtual Origin origin() = 0;
@@ -79,7 +79,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;
URL parse_url(StringView);
URL::URL parse_url(StringView);
JS::Realm& realm();
JS::Object& global_object();