LibWeb: Make StyleValue::to_string() infallible

This commit is contained in:
Sam Atkins
2023-08-22 14:08:15 +01:00
committed by Sam Atkins
parent ccfe197e5a
commit 7fe97ee6c5
Notes: sideshowbarker 2024-07-17 05:01:20 +09:00
112 changed files with 425 additions and 430 deletions

View File

@@ -11,11 +11,11 @@
namespace Web::CSS {
ErrorOr<String> BorderRadiusStyleValue::to_string() const
String BorderRadiusStyleValue::to_string() const
{
if (m_properties.horizontal_radius == m_properties.vertical_radius)
return m_properties.horizontal_radius.to_string();
return String::formatted("{} / {}", m_properties.horizontal_radius.to_string(), m_properties.vertical_radius.to_string());
return MUST(String::formatted("{} / {}", m_properties.horizontal_radius.to_string(), m_properties.vertical_radius.to_string()));
}
ValueComparingNonnullRefPtr<StyleValue const> BorderRadiusStyleValue::absolutized(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const