1
Fork 0
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:
Sam Atkins 2023-08-19 15:33:21 +01:00 committed by Andreas Kling
parent e177cef8ff
commit eca144a75e
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());