1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00

LibWeb: Implement WindowEventHandlers

This commit is contained in:
Luke Wilde 2022-06-27 19:48:54 +01:00 committed by Linus Groh
parent ebf2184636
commit 3fe66bddf4
15 changed files with 186 additions and 9 deletions

View file

@ -137,10 +137,11 @@ void WindowObject::initialize_global_object()
// WebAssembly "namespace"
define_direct_property("WebAssembly", heap().allocate<WebAssemblyObject>(*this, *this), JS::Attribute::Enumerable | JS::Attribute::Configurable);
// HTML::GlobalEventHandlers
// HTML::GlobalEventHandlers and HTML::WindowEventHandlers
#define __ENUMERATE(attribute, event_name) \
define_native_accessor(#attribute, attribute##_getter, attribute##_setter, attr);
ENUMERATE_GLOBAL_EVENT_HANDLERS(__ENUMERATE);
ENUMERATE_WINDOW_EVENT_HANDLERS(__ENUMERATE);
#undef __ENUMERATE
ADD_WINDOW_OBJECT_INTERFACES;
@ -719,6 +720,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::name_setter)
return JS::js_undefined(); \
}
ENUMERATE_GLOBAL_EVENT_HANDLERS(__ENUMERATE)
ENUMERATE_WINDOW_EVENT_HANDLERS(__ENUMERATE)
#undef __ENUMERATE
}