1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:27:35 +00:00

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.
This commit is contained in:
Andreas Kling 2022-10-20 15:51:34 +02:00
parent 8fd59fce9c
commit 940b455ed0

View file

@ -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();
}
)~~~");
}