diff --git a/Userland/Libraries/LibWeb/HTML/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp
index 0df34e76ebb..fb5efb24c71 100644
--- a/Userland/Libraries/LibWeb/HTML/Window.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Window.cpp
@@ -1207,13 +1207,6 @@ WebIDL::ExceptionOr Window::initialize_web_interfaces(Badge(realm, realm)), JS::Attribute::Enumerable | JS::Attribute::Configurable);
- // HTML::GlobalEventHandlers and HTML::WindowEventHandlers
-#define __ENUMERATE(attribute, event_name) \
- define_native_accessor(realm, #attribute, attribute##_getter, attribute##_setter, attr);
- ENUMERATE_GLOBAL_EVENT_HANDLERS(__ENUMERATE);
- ENUMERATE_WINDOW_EVENT_HANDLERS(__ENUMERATE);
-#undef __ENUMERATE
-
return {};
}
@@ -1963,29 +1956,4 @@ JS_DEFINE_NATIVE_FUNCTION(Window::navigator_getter)
return impl->m_navigator;
}
-#define __ENUMERATE(attribute, event_name) \
- JS_DEFINE_NATIVE_FUNCTION(Window::attribute##_getter) \
- { \
- auto* impl = TRY(impl_from(vm)); \
- auto retval = impl->attribute(); \
- if (!retval) \
- return JS::js_null(); \
- return &retval->callback; \
- } \
- JS_DEFINE_NATIVE_FUNCTION(Window::attribute##_setter) \
- { \
- auto* impl = TRY(impl_from(vm)); \
- auto value = vm.argument(0); \
- WebIDL::CallbackType* cpp_value = nullptr; \
- if (value.is_object()) { \
- cpp_value = vm.heap().allocate_without_realm( \
- value.as_object(), HTML::incumbent_settings_object()); \
- } \
- impl->set_##attribute(cpp_value); \
- return JS::js_undefined(); \
- }
-ENUMERATE_GLOBAL_EVENT_HANDLERS(__ENUMERATE)
-ENUMERATE_WINDOW_EVENT_HANDLERS(__ENUMERATE)
-#undef __ENUMERATE
-
}
diff --git a/Userland/Libraries/LibWeb/HTML/Window.h b/Userland/Libraries/LibWeb/HTML/Window.h
index 102d5a446af..75df91f6c83 100644
--- a/Userland/Libraries/LibWeb/HTML/Window.h
+++ b/Userland/Libraries/LibWeb/HTML/Window.h
@@ -291,13 +291,6 @@ private:
JS_DECLARE_NATIVE_FUNCTION(navigator_getter);
-#define __ENUMERATE(attribute, event_name) \
- JS_DECLARE_NATIVE_FUNCTION(attribute##_getter); \
- JS_DECLARE_NATIVE_FUNCTION(attribute##_setter);
- ENUMERATE_GLOBAL_EVENT_HANDLERS(__ENUMERATE);
- ENUMERATE_WINDOW_EVENT_HANDLERS(__ENUMERATE);
-#undef __ENUMERATE
-
HTML::Location* m_location { nullptr };
// [[CrossOriginPropertyDescriptorMap]], https://html.spec.whatwg.org/multipage/browsers.html#crossoriginpropertydescriptormap
diff --git a/Userland/Libraries/LibWeb/HTML/Window.idl b/Userland/Libraries/LibWeb/HTML/Window.idl
index 1de37150bae..19e5f269f74 100644
--- a/Userland/Libraries/LibWeb/HTML/Window.idl
+++ b/Userland/Libraries/LibWeb/HTML/Window.idl
@@ -1,6 +1,9 @@
+#import
#import
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#window
[Global=Window, Exposed=Window, LegacyUnenumerableNamedProperties]
interface Window : EventTarget {
};
+Window includes GlobalEventHandlers;
+Window includes WindowEventHandlers;