From b172b56757e25e3fe040738479f4ad55410a6605 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sat, 2 Apr 2022 00:42:37 +0300 Subject: [PATCH] LibWeb: Include relevant headers in IDL constructor implementations Similarly to implementations of prototype methods, the implementations of constructors sometimes require generated types. --- .../LibWeb/WrapperGenerator/IDLGenerators.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLGenerators.cpp index 9de6d960ac..0dc6fb103b 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLGenerators.cpp @@ -2657,6 +2657,14 @@ void generate_constructor_implementation(IDL::Interface const& interface) # include #endif +)~~~"); + + for (auto& path : interface.required_imported_paths) + generate_include_for(generator, path); + + emit_includes_for_all_imports(interface, generator, interface.pair_iterator_types.has_value()); + + generator.append(R"~~~( // FIXME: This is a total hack until we can figure out the namespace for a given type somehow. using namespace Web::CSS; using namespace Web::DOM;