mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-11 05:32:59 +00:00
LibHTML: Use an enum for CSS property ID's
Instead of using string everywhere, have the CSS parser produce enum values, since they are a lot nicer to work with. In the future we should generate most of this code based on a list of supported CSS properties.
This commit is contained in:
parent
19dbfc3153
commit
31ac19543a
Notes:
sideshowbarker
2024-07-19 11:45:17 +09:00
Author: https://github.com/awesomekling
Commit: 31ac19543a
18 changed files with 207 additions and 94 deletions
|
@ -114,10 +114,10 @@ void dump_tree(const LayoutNode& layout_node)
|
|||
}
|
||||
}
|
||||
|
||||
layout_node.style().for_each_property([&](auto& key, auto& value) {
|
||||
layout_node.style().for_each_property([&](auto property_id, auto& value) {
|
||||
for (int i = 0; i < indent; ++i)
|
||||
dbgprintf(" ");
|
||||
dbgprintf(" (%s: %s)\n", key.characters(), value.to_string().characters());
|
||||
dbgprintf(" (CSS::PropertyID(%u): %s)\n", (unsigned)property_id, value.to_string().characters());
|
||||
});
|
||||
|
||||
++indent;
|
||||
|
@ -170,7 +170,7 @@ void dump_rule(const StyleRule& rule)
|
|||
}
|
||||
dbgprintf(" Declarations:\n");
|
||||
for (auto& property : rule.declaration().properties()) {
|
||||
dbgprintf(" '%s': '%s'\n", property.name.characters(), property.value->to_string().characters());
|
||||
dbgprintf(" CSS::PropertyID(%u): '%s'\n", (unsigned)property.property_id, property.value->to_string().characters());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue