mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +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:
@@ -1,4 +1,5 @@
|
||||
#include <AK/Utf8View.h>
|
||||
#include <LibHTML/CSS/PropertyID.h>
|
||||
#include <LibHTML/CSS/StyleSheet.h>
|
||||
#include <LibHTML/DOM/Comment.h>
|
||||
#include <LibHTML/DOM/Document.h>
|
||||
@@ -128,7 +129,7 @@ void dump_tree(const LayoutNode& layout_node)
|
||||
layout_node.style().for_each_property([&](auto property_id, auto& value) {
|
||||
for (int i = 0; i < indent; ++i)
|
||||
dbgprintf(" ");
|
||||
dbgprintf(" (CSS::PropertyID(%u): %s)\n", (unsigned)property_id, value.to_string().characters());
|
||||
dbgprintf(" (%s: %s)\n", CSS::string_from_property_id(property_id), value.to_string().characters());
|
||||
});
|
||||
|
||||
++indent;
|
||||
|
||||
Reference in New Issue
Block a user