diff --git a/Tests/LibWeb/Text/expected/css/box-shadow-resolves-length-functions.txt b/Tests/LibWeb/Text/expected/css/box-shadow-resolves-length-functions.txt index c6350fa96a..5293c66b8c 100644 --- a/Tests/LibWeb/Text/expected/css/box-shadow-resolves-length-functions.txt +++ b/Tests/LibWeb/Text/expected/css/box-shadow-resolves-length-functions.txt @@ -1 +1 @@ -0 calc(5px - 10px) 0 calc(2px + 3px) => #000000ff 0px -5px 0px 5px +0 calc(5px - 10px) 0 calc(2px + 3px) => rgb(0, 0, 0) 0px -5px 0px 5px diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ShadowStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/ShadowStyleValue.cpp index 14b5680c5e..13a255c53e 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ShadowStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ShadowStyleValue.cpp @@ -7,14 +7,16 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include "ShadowStyleValue.h" +#include +#include namespace Web::CSS { String ShadowStyleValue::to_string() const { StringBuilder builder; - builder.appendff("{} {} {} {} {}", m_properties.color.to_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()); + serialize_a_srgb_value(builder, m_properties.color); + builder.appendff(" {} {} {} {}", 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) builder.append(" inset"sv); return MUST(builder.to_string());