1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +00:00

LibWeb: Add the Web::URL namespace and move URLEncoder to it

This namespace will be used for all interfaces defined in the URL
specification, like URL and URLSearchParams.

This has the unfortunate side-effect of requiring us to use the fully
qualified AK::URL name whenever we want to refer to the AK class, so
this commit also fixes all such references.
This commit is contained in:
Idan Horowitz 2021-09-13 00:33:23 +03:00 committed by Andreas Kling
parent 2b78e227f2
commit 4629f2e4ad
54 changed files with 236 additions and 225 deletions

View file

@ -162,7 +162,7 @@ bool FrameLoader::load(LoadRequest& request, Type type)
return true;
if (url.protocol() == "http" || url.protocol() == "https") {
URL favicon_url;
AK::URL favicon_url;
favicon_url.set_protocol(url.protocol());
favicon_url.set_host(url.host());
favicon_url.set_port(url.port());
@ -195,7 +195,7 @@ bool FrameLoader::load(LoadRequest& request, Type type)
return true;
}
bool FrameLoader::load(const URL& url, Type type)
bool FrameLoader::load(const AK::URL& url, Type type)
{
dbgln_if(SPAM_DEBUG, "FrameLoader::load: {}", url);
@ -208,7 +208,7 @@ bool FrameLoader::load(const URL& url, Type type)
return load(request, type);
}
void FrameLoader::load_html(const StringView& html, const URL& url)
void FrameLoader::load_html(const StringView& html, const AK::URL& url)
{
auto document = DOM::Document::create(url);
HTML::HTMLDocumentParser parser(document, html, "utf-8");
@ -219,7 +219,7 @@ void FrameLoader::load_html(const StringView& html, const URL& url)
// FIXME: Use an actual templating engine (our own one when it's built, preferably
// with a way to check these usages at compile time)
void FrameLoader::load_error_page(const URL& failed_url, const String& error)
void FrameLoader::load_error_page(const AK::URL& failed_url, const String& error)
{
auto error_page_url = "file:///res/html/error.html";
ResourceLoader::the().load(