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

@ -437,7 +437,7 @@ int main(int argc, char** argv)
return 1;
}
if (namespace_.is_one_of("CSS", "DOM", "HTML", "UIEvents", "HighResolutionTime", "NavigationTiming", "SVG", "XHR")) {
if (namespace_.is_one_of("CSS", "DOM", "HTML", "UIEvents", "HighResolutionTime", "NavigationTiming", "SVG", "XHR", "URL")) {
StringBuilder builder;
builder.append(namespace_);
builder.append("::");
@ -968,6 +968,8 @@ static void generate_header(IDL::Interface const& interface)
# include <LibWeb/SVG/@name@.h>
#elif __has_include(<LibWeb/XHR/@name@.h>)
# include <LibWeb/XHR/@name@.h>
#elif __has_include(<LibWeb/URL/@name@.h>)
# include <LibWeb/URL/@name@.h>
#endif
)~~~");
@ -1235,6 +1237,8 @@ void generate_constructor_implementation(IDL::Interface const& interface)
# include <LibWeb/SVG/@name@.h>
#elif __has_include(<LibWeb/XHR/@name@.h>)
# include <LibWeb/XHR/@name@.h>
#elif __has_include(<LibWeb/URL/@name@.h>)
# include <LibWeb/URL/@name@.h>
#endif
// FIXME: This is a total hack until we can figure out the namespace for a given type somehow.
@ -1504,6 +1508,8 @@ void generate_prototype_implementation(IDL::Interface const& interface)
# include <LibWeb/SVG/@name@.h>
#elif __has_include(<LibWeb/XHR/@name@.h>)
# include <LibWeb/XHR/@name@.h>
#elif __has_include(<LibWeb/URL/@name@.h>)
# include <LibWeb/URL/@name@.h>
#endif
// FIXME: This is a total hack until we can figure out the namespace for a given type somehow.
@ -1512,6 +1518,7 @@ using namespace Web::DOM;
using namespace Web::HTML;
using namespace Web::NavigationTiming;
using namespace Web::XHR;
using namespace Web::URL;
namespace Web::Bindings {