LibWeb/CSS: Set enum sizes for PropertyID and Keyword

The effect of this is hard to measure, but reducing them from 4 bytes
each to 2 bytes can't hurt. :^)
This commit is contained in:
Sam Atkins 2025-05-19 12:51:01 +01:00 committed by Shannon Booth
commit 6e45d8ba6c
Notes: github-actions[bot] 2025-05-19 22:15:17 +00:00
5 changed files with 8 additions and 7 deletions

View file

@ -126,6 +126,7 @@ ErrorOr<void> generate_header_file(JsonObject& properties, Core::File& file)
{
StringBuilder builder;
SourceGenerator generator { builder };
generator.set("property_id_underlying_type", underlying_type_for_enum(properties.size()));
generator.append(R"~~~(
#pragma once
@ -137,7 +138,7 @@ ErrorOr<void> generate_header_file(JsonObject& properties, Core::File& file)
namespace Web::CSS {
enum class PropertyID {
enum class PropertyID : @property_id_underlying_type@ {
Invalid,
Custom,
All,