LibWeb: Don't include spread distance when serializing text-shadow

We shouldn't include spread distance when serializing `text-shadow` as
it is not supported unlike `box-shadow` - to achieve this we store
whether this is a text or box shadow within the ShadowStyleValue and
serialize appropriately.
This commit is contained in:
Callum Law 2025-09-15 20:52:20 +12:00 committed by Sam Atkins
commit c3a78d2884
Notes: github-actions[bot] 2025-09-18 14:23:44 +00:00
6 changed files with 27 additions and 23 deletions

View file

@ -961,6 +961,7 @@ RefPtr<StyleValue const> interpolate_box_shadow(DOM::Element& element, Calculati
values.ensure_capacity(other.size());
for (size_t i = values.size(); i < other.size(); i++) {
values.unchecked_append(ShadowStyleValue::create(
other.get(0).value()->as_shadow().shadow_type(),
ColorStyleValue::create_from_color(Color::Transparent, ColorSyntax::Legacy),
LengthStyleValue::create(Length::make_px(0)),
LengthStyleValue::create(Length::make_px(0)),
@ -1012,6 +1013,7 @@ RefPtr<StyleValue const> interpolate_box_shadow(DOM::Element& element, Calculati
interpolated_color = interpolate_color(from_color.value(), to_color.value(), delta, color_syntax);
auto result_shadow = ShadowStyleValue::create(
from_shadow.shadow_type(),
ColorStyleValue::create_from_color(interpolated_color, ColorSyntax::Modern),
*interpolated_offset_x,
*interpolated_offset_y,