mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:17: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:
parent
8fd59fce9c
commit
940b455ed0
1 changed files with 4 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
)~~~");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue