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

LibWeb: Expose the GlobalEventHandlers mixin on the Window object

We now expose all the `onfoo` event handler attributes on the window
object. This makes `window.onload = ...` actually work. :^)
This commit is contained in:
Andreas Kling 2021-09-22 16:39:15 +02:00
parent fb2f7c7b9c
commit 635ab6db0b
3 changed files with 54 additions and 1 deletions

View file

@ -11,6 +11,7 @@
#include <AK/Weakable.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibWeb/Forward.h>
#include <LibWeb/HTML/GlobalEventHandlers.h>
namespace Web {
namespace Bindings {
@ -98,6 +99,12 @@ private:
JS_DECLARE_NATIVE_FUNCTION(get_computed_style);
JS_DECLARE_NATIVE_FUNCTION(match_media);
#define __ENUMERATE(attribute, event_name) \
JS_DECLARE_NATIVE_FUNCTION(attribute##_getter); \
JS_DECLARE_NATIVE_FUNCTION(attribute##_setter);
ENUMERATE_GLOBAL_EVENT_HANDLERS(__ENUMERATE);
#undef __ENUMERATE
NonnullRefPtr<DOM::Window> m_impl;
LocationObject* m_location_object { nullptr };