LibWeb: Generate pseudo-element code from JSON

Initially, this generates the enum and to/from-string functions. The
JSON itself contains more data than that, but it's unused for now.
This commit is contained in:
Sam Atkins 2025-03-19 14:58:22 +00:00
commit ffa1dba96a
Notes: github-actions[bot] 2025-03-24 09:51:30 +00:00
14 changed files with 244 additions and 106 deletions

View file

@ -99,7 +99,7 @@ void dump_tree(StringBuilder& builder, DOM::Node const& node)
if (element.use_pseudo_element().has_value()) {
for (int i = 0; i < indent; ++i)
builder.append(" "sv);
builder.appendff(" (pseudo-element: {})\n", CSS::Selector::PseudoElementSelector::name(element.use_pseudo_element().value()));
builder.appendff(" (pseudo-element: {})\n", CSS::pseudo_element_name(element.use_pseudo_element().value()));
}
} else if (is<DOM::Text>(node)) {
builder.appendff("\"{}\"\n", as<DOM::Text>(node).data());