mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:18:13 +00:00
LibWeb: Make absolutizing StyleValues infallible
This commit is contained in:
parent
e177cef8ff
commit
eca144a75e
10 changed files with 17 additions and 18 deletions
|
@ -27,7 +27,7 @@ ValueComparingNonnullRefPtr<LengthStyleValue> LengthStyleValue::create(Length co
|
|||
return adopt_ref(*new (nothrow) LengthStyleValue(length));
|
||||
}
|
||||
|
||||
ErrorOr<ValueComparingNonnullRefPtr<StyleValue const>> LengthStyleValue::absolutized(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const
|
||||
ValueComparingNonnullRefPtr<StyleValue const> LengthStyleValue::absolutized(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const
|
||||
{
|
||||
if (auto length = m_length.absolutize(viewport_rect, font_metrics, root_font_metrics); length.has_value())
|
||||
return LengthStyleValue::create(length.release_value());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue