From 940b455ed08ecdb71ceb6c9e106b6760adea0020 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 20 Oct 2022 15:51:34 +0200 Subject: [PATCH] LibWeb: Teach IDL generator to go from WindowProxy to EventTarget This case requires some special handling, since there's no direct C++ inheritance relationship between HTML::WindowProxy and DOM::EventTarget. --- .../CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index 2bfa3b1326..8f979aa75f 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -2393,6 +2393,7 @@ void generate_prototype_implementation(IDL::Interface const& interface) #include #include #include +#include #include #if __has_include() @@ -2597,6 +2598,9 @@ static JS::ThrowCompletionOr<@fully_qualified_name@*> impl_from(JS::VM& vm) if (is(this_object)) { return static_cast(this_object); } + if (is(this_object)) { + return static_cast(this_object)->window().ptr(); + } )~~~"); }