mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:58:12 +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
|
@ -83,4 +83,10 @@ Optional<Time::Type> Time::unit_from_name(StringView name)
|
|||
return {};
|
||||
}
|
||||
|
||||
NonnullRefPtr<CalculatedStyleValue> Time::calculated_style_value() const
|
||||
{
|
||||
VERIFY(!m_calculated_style.is_null());
|
||||
return *m_calculated_style;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue