1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:27:45 +00:00

LibWeb: Add resolving calc() to a number/integer/percentage

None of these require any outside metrics, which is nice! I believe the
Values-4 spec would have us simplify them down into a single value at
parse time, but that's a yak for another day.
This commit is contained in:
Sam Atkins 2022-01-27 15:46:24 +00:00 committed by Andreas Kling
parent e111e8e44e
commit 2407a03fd9
2 changed files with 27 additions and 0 deletions

View file

@ -803,6 +803,9 @@ public:
NonnullOwnPtr<CalcSum> const& expression() const { return m_expression; }
Optional<Length> resolve_length(Layout::Node const& layout_node) const;
Optional<LengthPercentage> resolve_length_percentage(Layout::Node const&, Length const& percentage_basis) const;
Optional<Percentage> resolve_percentage() const;
Optional<float> resolve_number();
Optional<i64> resolve_integer();
private:
explicit CalculatedStyleValue(String const& expression_string, NonnullOwnPtr<CalcSum> calc_sum, ResolvedType resolved_type)