mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibWeb: Propagate errors from absolutizing StyleValues
This commit is contained in:
parent
d16600a48b
commit
d732a83de8
Notes:
sideshowbarker
2024-07-17 05:19:06 +09:00
Author: https://github.com/AtkinsSJ
Commit: d732a83de8
Pull-request: https://github.com/SerenityOS/serenity/pull/18607
10 changed files with 20 additions and 20 deletions
|
@ -18,7 +18,7 @@ ErrorOr<String> BorderRadiusStyleValue::to_string() const
|
|||
return String::formatted("{} / {}", TRY(m_properties.horizontal_radius.to_string()), TRY(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
|
||||
ErrorOr<ValueComparingNonnullRefPtr<StyleValue const>> BorderRadiusStyleValue::absolutized(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const
|
||||
{
|
||||
if (m_properties.horizontal_radius.is_percentage() && m_properties.vertical_radius.is_percentage())
|
||||
return *this;
|
||||
|
@ -28,7 +28,7 @@ ValueComparingNonnullRefPtr<StyleValue const> BorderRadiusStyleValue::absolutize
|
|||
absolutized_horizontal_radius = m_properties.horizontal_radius.length().absolutized(viewport_rect, font_metrics, root_font_metrics);
|
||||
if (!m_properties.vertical_radius.is_percentage())
|
||||
absolutized_vertical_radius = m_properties.vertical_radius.length().absolutized(viewport_rect, font_metrics, root_font_metrics);
|
||||
return BorderRadiusStyleValue::create(absolutized_horizontal_radius, absolutized_vertical_radius).release_value_but_fixme_should_propagate_errors();
|
||||
return BorderRadiusStyleValue::create(absolutized_horizontal_radius, absolutized_vertical_radius);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue