1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 14:44:57 +00:00

LibHTML: Start building a simple code generator for CSS properties

Code for parsing and stringifying CSS properties is now generated based
on LibHTML/CSS/Properties.json

At the moment, the file tells us three things:

- The name of a property
- Its initial value
- Whether it's inherited

Also, for shorthand properties, it provides a list of all the longhand
properties it may expand too. This is not actually used in the engine
yet though.

This *finally* makes layout tree dumps show the names of CSS properties
in effect, instead of "CSS::PropertyID(32)" and such. :^)
This commit is contained in:
Andreas Kling 2019-11-18 11:12:58 +01:00
parent dcd10149fe
commit e6e41e4fb8
10 changed files with 529 additions and 115 deletions

View file

@ -0,0 +1,33 @@
PROGRAM = Generate_CSS_PropertyID_cpp
OBJS = \
Generate_CSS_PropertyID_cpp.o \
$(SERENITY_ROOT)/AK/String.o \
$(SERENITY_ROOT)/AK/StringImpl.o \
$(SERENITY_ROOT)/AK/StringBuilder.o \
$(SERENITY_ROOT)/AK/StringView.o \
$(SERENITY_ROOT)/AK/JsonValue.o \
$(SERENITY_ROOT)/AK/JsonParser.o \
$(SERENITY_ROOT)/AK/LogStream.o \
$(SERENITY_ROOT)/Libraries/LibCore/CIODevice.o \
$(SERENITY_ROOT)/Libraries/LibCore/CFile.o \
$(SERENITY_ROOT)/Libraries/LibCore/CObject.o \
$(SERENITY_ROOT)/Libraries/LibCore/CEvent.o \
$(SERENITY_ROOT)/Libraries/LibCore/CSocket.o \
$(SERENITY_ROOT)/Libraries/LibCore/CLocalSocket.o \
$(SERENITY_ROOT)/Libraries/LibCore/CNotifier.o \
$(SERENITY_ROOT)/Libraries/LibCore/CLocalServer.o \
$(SERENITY_ROOT)/Libraries/LibCore/CEventLoop.o
all: $(PROGRAM)
CXXFLAGS = -std=c++17 -Wall -Wextra
%.o: %.cpp
$(PRE_CXX) $(CXX) $(CXXFLAGS) -I../ -I$(SERENITY_ROOT)/ -I$(SERENITY_ROOT)/Libraries/ -o $@ -c $<
$(PROGRAM): $(OBJS)
$(CXX) $(LDFLAGS) -I../ -I$(SERENITY_ROOT)/ -I$(SERENITY_ROOT)/Libraries/ -o $(PROGRAM) $(OBJS)
clean:
rm -f $(PROGRAM) $(OBJS)