1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 18:37:34 +00:00

LibWeb: Add a new code generator for CSS enums

Alias values are represented by "alias-name=real-name".

We have a lot of repetitive code for converting between ValueID and
property-specific enums. Let's see if we can generate it. :^)

This first step just produces the enums, from a JSON file. The values in
there are a duplication of what's in Properties.json, but eventually
those will go away.
This commit is contained in:
Sam Atkins 2022-04-13 16:48:03 +01:00 committed by Andreas Kling
parent 66170ff632
commit a97944e483
4 changed files with 328 additions and 0 deletions

View file

@ -36,6 +36,7 @@ set(SOURCES
CSS/CSSSupportsRule.cpp
CSS/DefaultStyleSheetSource.cpp
CSS/Display.cpp
CSS/Enums.cpp
CSS/FontFace.cpp
CSS/Frequency.cpp
CSS/Length.cpp
@ -616,6 +617,16 @@ libweb_js_wrapper(XHR/ProgressEvent)
libweb_js_wrapper(XHR/XMLHttpRequest)
libweb_js_wrapper(XHR/XMLHttpRequestEventTarget)
invoke_generator(
"Enums"
Lagom::GenerateCSSEnums
"${CMAKE_CURRENT_SOURCE_DIR}/CSS/Enums.json"
""
"CSS/Enums.h"
"CSS/Enums.cpp"
arguments -j "${CMAKE_CURRENT_SOURCE_DIR}/CSS/Enums.json"
)
invoke_generator(
"MediaFeatureID"
Lagom::GenerateCSSMediaFeatureID