LibWeb/CSS: Introduce helper methods for parsing numeric values

"Parse a style value for <foo>", where we don't care if it's a literal
<foo> or a calculated one, is a really common thing that we previously
didn't have methods for.

A couple of methods we had have been extended to parse calc(), and the
others have been filled in.

The method for parsing the `flex` property's value is renamed
`parse_flex_shorthand_value()` as it conflicted.
This commit is contained in:
Sam Atkins 2024-08-16 09:41:10 +01:00 committed by Sam Atkins
commit 27be8678c9
Notes: github-actions[bot] 2024-08-21 09:52:50 +00:00
3 changed files with 207 additions and 30 deletions

View file

@ -117,6 +117,8 @@ public:
Optional<double> resolve_number() const;
Optional<i64> resolve_integer() const;
bool resolves_to_dimension() const { return m_resolved_type.matches_dimension(); }
bool contains_percentage() const;
private: