1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +00:00

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
38 changed files with 1747 additions and 143 deletions

View file

@ -0,0 +1,30 @@
/*
* Copyright (c) 2023, Luke Wilde <lukew@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/FlyString.h>
namespace Web::HTML::CustomElementReactionNames {
// https://html.spec.whatwg.org/multipage/custom-elements.html#concept-custom-element-definition-lifecycle-callbacks
#define ENUMERATE_CUSTOM_ELEMENT_REACTION_NAMES \
__ENUMERATE_CUSTOM_ELEMENT_REACTION_NAME(connectedCallback) \
__ENUMERATE_CUSTOM_ELEMENT_REACTION_NAME(disconnectedCallback) \
__ENUMERATE_CUSTOM_ELEMENT_REACTION_NAME(adoptedCallback) \
__ENUMERATE_CUSTOM_ELEMENT_REACTION_NAME(attributeChangedCallback) \
__ENUMERATE_CUSTOM_ELEMENT_REACTION_NAME(formAssociatedCallback) \
__ENUMERATE_CUSTOM_ELEMENT_REACTION_NAME(formDisabledCallback) \
__ENUMERATE_CUSTOM_ELEMENT_REACTION_NAME(formResetCallback) \
__ENUMERATE_CUSTOM_ELEMENT_REACTION_NAME(formStateRestoreCallback)
#define __ENUMERATE_CUSTOM_ELEMENT_REACTION_NAME(name) extern FlyString name;
ENUMERATE_CUSTOM_ELEMENT_REACTION_NAMES
#undef __ENUMERATE_CUSTOM_ELEMENT_REACTION_NAME
ErrorOr<void> initialize_strings();
}