LibWeb: Make absolutizing StyleValues infallible

This commit is contained in:
Sam Atkins 2023-08-19 15:33:21 +01:00 committed by Andreas Kling
commit eca144a75e
Notes: sideshowbarker 2024-07-18 00:34:07 +09:00
10 changed files with 17 additions and 18 deletions

View file

@ -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());