ladybird/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementReactionNames.cpp
Luke Wilde 034aaf3f51 LibWeb: Introduce CustomElementRegistry and creating custom elements
The main missing feature here is form associated custom elements.
2023-04-06 11:36:56 +02:00

29 lines
725 B
C++

/*
* Copyright (c) 2023, Luke Wilde <lukew@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/HTML/CustomElements/CustomElementReactionNames.h>
namespace Web::HTML::CustomElementReactionNames {
#define __ENUMERATE_CUSTOM_ELEMENT_REACTION_NAME(name) FlyString name;
ENUMERATE_CUSTOM_ELEMENT_REACTION_NAMES
#undef __ENUMERATE_CUSTOM_ELEMENT_REACTION_NAME
ErrorOr<void> initialize_strings()
{
static bool s_initialized = false;
VERIFY(!s_initialized);
#define __ENUMERATE_CUSTOM_ELEMENT_REACTION_NAME(name) \
name = TRY(#name##_fly_string);
ENUMERATE_CUSTOM_ELEMENT_REACTION_NAMES
#undef __ENUMERATE_CUSTOM_ELEMENT_REACTION_NAME
s_initialized = true;
return {};
}
}