mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 09:46:04 -05:00
4f73851afc
Let's stop putting generic types and AOs from the Web IDL spec into the Bindings namespace and directory in LibWeb, and instead follow our usual naming rules of 'directory = namespace = spec name'. The IDL namespace is already used by LibIDL, so Web::WebIDL seems like a good choice.
28 lines
1.2 KiB
C++
28 lines
1.2 KiB
C++
/*
|
|
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/DOM/EventTarget.h>
|
|
#include <LibWeb/HTML/EventNames.h>
|
|
#include <LibWeb/HTML/WindowEventHandlers.h>
|
|
|
|
namespace Web::HTML {
|
|
|
|
#undef __ENUMERATE
|
|
#define __ENUMERATE(attribute_name, event_name) \
|
|
void WindowEventHandlers::set_##attribute_name(WebIDL::CallbackType* value) \
|
|
{ \
|
|
window_event_handlers_to_event_target().set_event_handler_attribute(event_name, value); \
|
|
} \
|
|
WebIDL::CallbackType* WindowEventHandlers::attribute_name() \
|
|
{ \
|
|
return window_event_handlers_to_event_target().event_handler_attribute(event_name); \
|
|
}
|
|
ENUMERATE_WINDOW_EVENT_HANDLERS(__ENUMERATE)
|
|
#undef __ENUMERATE
|
|
|
|
WindowEventHandlers::~WindowEventHandlers() = default;
|
|
|
|
}
|