mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
LibWeb: Make StyleValue::to_string() infallible
This commit is contained in:
parent
ccfe197e5a
commit
7fe97ee6c5
112 changed files with 425 additions and 430 deletions
|
@ -11,13 +11,13 @@
|
|||
|
||||
namespace Web::CSS {
|
||||
|
||||
ErrorOr<String> ShadowStyleValue::to_string() const
|
||||
String ShadowStyleValue::to_string() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
TRY(builder.try_appendff("{} {} {} {} {}", m_properties.color.to_deprecated_string(), TRY(m_properties.offset_x->to_string()), TRY(m_properties.offset_y->to_string()), TRY(m_properties.blur_radius->to_string()), TRY(m_properties.spread_distance->to_string())));
|
||||
builder.appendff("{} {} {} {} {}", m_properties.color.to_deprecated_string(), m_properties.offset_x->to_string(), m_properties.offset_y->to_string(), m_properties.blur_radius->to_string(), m_properties.spread_distance->to_string());
|
||||
if (m_properties.placement == ShadowPlacement::Inner)
|
||||
TRY(builder.try_append(" inset"sv));
|
||||
return builder.to_string();
|
||||
builder.append(" inset"sv);
|
||||
return MUST(builder.to_string());
|
||||
}
|
||||
|
||||
ValueComparingNonnullRefPtr<StyleValue const> ShadowStyleValue::absolutized(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue