LibWeb: Introduce CustomElementRegistry and creating custom elements

The main missing feature here is form associated custom elements.
This commit is contained in:
Luke Wilde
2023-03-29 23:46:18 +01:00
committed by Andreas Kling
parent 083b547e97
commit 034aaf3f51
Notes: sideshowbarker 2024-07-16 23:23:26 +09:00
38 changed files with 1747 additions and 143 deletions

View File

@@ -0,0 +1,29 @@
/*
* 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 {};
}
}