LibWeb: Define a PropertyIDOrCustomPropertyName type

We often want to identify a property, but if we have a PropertyID we
don't want to have to convert it to a string to then convert it back
again. However, custom properties don't have a useful PropertyID. So,
here's a type with a verbose name.
This commit is contained in:
Sam Atkins 2025-06-26 16:48:20 +01:00 committed by Tim Ledbetter
commit 1ff1093a24
Notes: github-actions[bot] 2025-07-09 15:46:02 +00:00

View file

@ -182,6 +182,7 @@ ErrorOr<void> generate_header_file(JsonObject& properties, JsonObject&, Core::Fi
#include <AK/NonnullRefPtr.h>
#include <AK/StringView.h>
#include <AK/Traits.h>
#include <AK/Variant.h>
#include <LibJS/Forward.h>
#include <LibWeb/CSS/Enums.h>
#include <LibWeb/Forward.h>
@ -255,6 +256,8 @@ enum class PropertyID : @property_id_underlying_type@ {
generator.append(R"~~~(
};
using PropertyIDOrCustomPropertyName = Variant<PropertyID, FlyString>;
enum class AnimationType {
Discrete,
ByComputedValue,