1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:48: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

@ -11,7 +11,7 @@
namespace Web::HTML {
// https://html.spec.whatwg.org/multipage/webappapis.html#creating-a-classic-script
NonnullRefPtr<ClassicScript> ClassicScript::create(String filename, StringView source, JS::Realm& realm, URL base_url, MutedErrors muted_errors)
NonnullRefPtr<ClassicScript> ClassicScript::create(String filename, StringView source, JS::Realm& realm, AK::URL base_url, MutedErrors muted_errors)
{
// 1. If muted errors was not provided, let it be false. (NOTE: This is taken care of by the default argument.)
@ -65,7 +65,7 @@ JS::Value ClassicScript::run(RethrowErrors rethrow_errors)
return vm.last_value();
}
ClassicScript::ClassicScript(URL base_url, String filename)
ClassicScript::ClassicScript(AK::URL base_url, String filename)
: Script(move(base_url), move(filename))
{
}

View file

@ -20,7 +20,7 @@ public:
No,
Yes,
};
static NonnullRefPtr<ClassicScript> create(String filename, StringView source, JS::Realm&, URL base_url, MutedErrors = MutedErrors::No);
static NonnullRefPtr<ClassicScript> create(String filename, StringView source, JS::Realm&, AK::URL base_url, MutedErrors = MutedErrors::No);
JS::Script* script_record() { return m_script_record; }
JS::Script const* script_record() const { return m_script_record; }
@ -32,7 +32,7 @@ public:
JS::Value run(RethrowErrors = RethrowErrors::No);
private:
ClassicScript(URL base_url, String filename);
ClassicScript(AK::URL base_url, String filename);
RefPtr<JS::Script> m_script_record;
MutedErrors m_muted_errors { MutedErrors::No };

View file

@ -8,7 +8,7 @@
namespace Web::HTML {
Script::Script(URL base_url, String filename)
Script::Script(AK::URL base_url, String filename)
: m_base_url(move(base_url))
, m_filename(move(filename))
{

View file

@ -16,14 +16,14 @@ class Script : public RefCounted<Script> {
public:
virtual ~Script();
URL const& base_url() const { return m_base_url; }
AK::URL const& base_url() const { return m_base_url; }
String const& filename() const { return m_filename; }
protected:
Script(URL base_url, String filename);
Script(AK::URL base_url, String filename);
private:
URL m_base_url;
AK::URL m_base_url;
String m_filename;
};