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:
Andreas Kling 2019-10-08 15:34:19 +02:00
parent 19dbfc3153
commit 31ac19543a
Notes: sideshowbarker 2024-07-19 11:45:17 +09:00
18 changed files with 207 additions and 94 deletions

View file

@ -17,7 +17,7 @@ void HTMLFontElement::apply_presentational_hints(StyleProperties& style) const
if (name == "color") {
auto color = Color::from_string(value);
if (color.has_value())
style.set_property("color", ColorStyleValue::create(color.value()));
style.set_property(CSS::PropertyID::Color, ColorStyleValue::create(color.value()));
}
});
}