summaryrefslogtreecommitdiff
path: root/Meta/Lagom/Tools
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-10-20 15:51:34 +0200
committerAndreas Kling <kling@serenityos.org>2022-10-20 15:52:20 +0200
commit940b455ed08ecdb71ceb6c9e106b6760adea0020 (patch)
tree2e6814b99fa322ad0a6b33fb51c430ccb3c87dc6 /Meta/Lagom/Tools
parent8fd59fce9c65704495db5a47f19cbe45533ae4a4 (diff)
downloadserenity-940b455ed08ecdb71ceb6c9e106b6760adea0020.zip
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.
Diffstat (limited to 'Meta/Lagom/Tools')
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp4
1 files changed, 4 insertions, 0 deletions
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 <LibWeb/HTML/Origin.h>
#include <LibWeb/HTML/Scripting/Environments.h>
#include <LibWeb/HTML/Window.h>
+#include <LibWeb/HTML/WindowProxy.h>
#include <LibWeb/WebIDL/OverloadResolution.h>
#if __has_include(<LibWeb/Bindings/@prototype_base_class@.h>)
@@ -2597,6 +2598,9 @@ static JS::ThrowCompletionOr<@fully_qualified_name@*> impl_from(JS::VM& vm)
if (is<HTML::Window>(this_object)) {
return static_cast<HTML::Window*>(this_object);
}
+ if (is<HTML::WindowProxy>(this_object)) {
+ return static_cast<HTML::WindowProxy*>(this_object)->window().ptr();
+ }
)~~~");
}