From 86f68eb3c354f563ac2ca5cc8d16a158c965c08a Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sat, 24 Sep 2022 16:18:31 +0100 Subject: [PATCH] LibWeb: Move IDLOverloadResolution from Bindings/ to WebIDL/ --- .../CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp | 4 ++-- Userland/Libraries/LibWeb/CMakeLists.txt | 2 +- .../OverloadResolution.cpp} | 4 ++-- .../IDLOverloadResolution.h => WebIDL/OverloadResolution.h} | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) rename Userland/Libraries/LibWeb/{Bindings/IDLOverloadResolution.cpp => WebIDL/OverloadResolution.cpp} (99%) rename Userland/Libraries/LibWeb/{Bindings/IDLOverloadResolution.h => WebIDL/OverloadResolution.h} (96%) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index 7c642e7d3e..856f776585 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -1928,7 +1928,7 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::@function.name:snakecase@) if (!effective_overload_set.has_value()) return vm.throw_completion(JS::ErrorType::OverloadResolutionFailed); - auto chosen_overload = TRY(resolve_overload(vm, effective_overload_set.value())); + auto chosen_overload = TRY(WebIDL::resolve_overload(vm, effective_overload_set.value())); switch (chosen_overload.callable_id) { )~~~"); @@ -2358,7 +2358,6 @@ void generate_prototype_implementation(IDL::Interface const& interface) #include #include #include -#include #include #include #include @@ -2368,6 +2367,7 @@ void generate_prototype_implementation(IDL::Interface const& interface) #include #include #include +#include #if __has_include() # include diff --git a/Userland/Libraries/LibWeb/CMakeLists.txt b/Userland/Libraries/LibWeb/CMakeLists.txt index abad3348d6..afc7a8c09d 100644 --- a/Userland/Libraries/LibWeb/CMakeLists.txt +++ b/Userland/Libraries/LibWeb/CMakeLists.txt @@ -3,7 +3,6 @@ include(libweb_generators) set(SOURCES Bindings/AudioConstructor.cpp Bindings/CSSNamespace.cpp - Bindings/IDLOverloadResolution.cpp Bindings/ImageConstructor.cpp Bindings/LegacyPlatformObject.cpp Bindings/LocationConstructor.cpp @@ -413,6 +412,7 @@ set(SOURCES WebGL/WebGLRenderingContextBase.cpp WebIDL/AbstractOperations.cpp WebIDL/CallbackType.cpp + WebIDL/OverloadResolution.cpp WebSockets/WebSocket.cpp XHR/EventNames.cpp XHR/ProgressEvent.cpp diff --git a/Userland/Libraries/LibWeb/Bindings/IDLOverloadResolution.cpp b/Userland/Libraries/LibWeb/WebIDL/OverloadResolution.cpp similarity index 99% rename from Userland/Libraries/LibWeb/Bindings/IDLOverloadResolution.cpp rename to Userland/Libraries/LibWeb/WebIDL/OverloadResolution.cpp index e2195a878c..acbcf9ccc4 100644 --- a/Userland/Libraries/LibWeb/Bindings/IDLOverloadResolution.cpp +++ b/Userland/Libraries/LibWeb/WebIDL/OverloadResolution.cpp @@ -9,10 +9,10 @@ #include #include #include -#include #include +#include -namespace Web::Bindings { +namespace Web::WebIDL { // https://webidl.spec.whatwg.org/#dfn-convert-ecmascript-to-idl-value static JS::Value convert_ecmascript_type_to_idl_value(JS::Value value, IDL::Type const&) diff --git a/Userland/Libraries/LibWeb/Bindings/IDLOverloadResolution.h b/Userland/Libraries/LibWeb/WebIDL/OverloadResolution.h similarity index 96% rename from Userland/Libraries/LibWeb/Bindings/IDLOverloadResolution.h rename to Userland/Libraries/LibWeb/WebIDL/OverloadResolution.h index 41a2efada0..dbed20a9ab 100644 --- a/Userland/Libraries/LibWeb/Bindings/IDLOverloadResolution.h +++ b/Userland/Libraries/LibWeb/WebIDL/OverloadResolution.h @@ -11,7 +11,7 @@ #include #include -namespace Web::Bindings { +namespace Web::WebIDL { struct ResolvedOverload { // Corresponds to "the special value “missing”" in the overload resolution algorithm.