LibWeb: Allow passing a resolution context to CSSStyleValue::to_color

This will be used for resolving any calculated style values within the
various `CSSColorValue` sub-classes.

No functionality changes.
This commit is contained in:
Callum Law 2025-06-29 12:56:28 +12:00 committed by Sam Atkins
parent b468923372
commit 62d138ebf7
Notes: github-actions[bot] 2025-07-04 12:20:15 +00:00
33 changed files with 105 additions and 105 deletions

View file

@ -669,7 +669,7 @@ RefPtr<CSSStyleValue const> interpolate_box_shadow(DOM::Element& element, Calcul
if (!interpolated_offset_x || !interpolated_offset_y || !interpolated_blur_radius || !interpolated_spread_distance)
return {};
auto result_shadow = ShadowStyleValue::create(
CSSColorValue::create_from_color(interpolate_color(from_shadow.color()->to_color({}), to_shadow.color()->to_color({}), delta), ColorSyntax::Modern),
CSSColorValue::create_from_color(interpolate_color(from_shadow.color()->to_color({}, {}), to_shadow.color()->to_color({}, {}), delta), ColorSyntax::Modern),
*interpolated_offset_x,
*interpolated_offset_y,
*interpolated_blur_radius,
@ -783,7 +783,7 @@ static RefPtr<CSSStyleValue const> interpolate_value_impl(DOM::Element& element,
Optional<Layout::NodeWithStyle const&> layout_node;
if (auto node = element.layout_node())
layout_node = *node;
return CSSColorValue::create_from_color(interpolate_color(from.to_color(layout_node), to.to_color(layout_node), delta), ColorSyntax::Modern);
return CSSColorValue::create_from_color(interpolate_color(from.to_color(layout_node, {}), to.to_color(layout_node, {}), delta), ColorSyntax::Modern);
}
case CSSStyleValue::Type::Edge: {
auto resolved_from = from.as_edge().resolved_value(calculation_context);