mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:47:45 +00:00
LibWeb: Expose StyleValue parsing method in CSS Parser
Now that StyleResolver is going to deal with StyleComponentValueRules, it will need to be able to parse those into StyleValues, using `parse_css_value()`. Also added StyleValue::is_builtin_or_dynamic(), which returns true for values that are valid anywhere - things like `initial` and `inherit`, along with `var()`, `attr()` and `calc()` - which we want to test for easily.
This commit is contained in:
parent
57d34f1966
commit
6e0376361a
3 changed files with 116 additions and 55 deletions
|
@ -239,6 +239,11 @@ public:
|
|||
bool is_numeric() const { return type() == Type::Numeric; }
|
||||
bool is_value_list() const { return type() == Type::ValueList; }
|
||||
|
||||
bool is_builtin_or_dynamic() const
|
||||
{
|
||||
return is_inherit() || is_initial() || is_custom_property();
|
||||
}
|
||||
|
||||
virtual String to_string() const = 0;
|
||||
virtual Length to_length() const { return Length::make_auto(); }
|
||||
virtual Color to_color(const DOM::Document&) const { return {}; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue