mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:27:35 +00:00
LibWeb: Ensure PercentageOr<T>::resolved() returns a concrete T
Which is to say, a T where `is_calculated()` is false. As is becoming a repeating theme with CSS types, we have two states for a FooPercentage that is a `calc()` expression: Either the FooPercentage holds the CalculatedStyleValue directly, or it holds a Foo which itself holds the CalculatedStyleValue. The first case was already handled to return Foo, and with this patch, the second is too. :^)
This commit is contained in:
parent
3fce4f7c91
commit
7b4004d682
9 changed files with 30 additions and 0 deletions
|
@ -29,6 +29,7 @@ public:
|
|||
Time percentage_of(Percentage const&) const;
|
||||
|
||||
bool is_calculated() const { return m_type == Type::Calculated; }
|
||||
NonnullRefPtr<CalculatedStyleValue> calculated_style_value() const;
|
||||
|
||||
String to_string() const;
|
||||
float to_seconds() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue