LibWeb: Make storage of CSS::CalculationNodes const-correct

Now we consistently use `RefPtr<CalculationNode const>` for all
CalculationNodes.
This commit is contained in:
Andrew Kaster 2025-04-15 15:21:37 -06:00 committed by Andrew Kaster
parent 6d11414957
commit d1f6f5649e
Notes: github-actions[bot] 2025-04-16 16:44:26 +00:00
7 changed files with 278 additions and 278 deletions

View file

@ -537,7 +537,7 @@ NonnullRefPtr<CSSStyleValue const> interpolate_value(DOM::Element& element, Calc
}
};
static auto to_calculation_node = [calculation_context](CSSStyleValue const& value) -> NonnullRefPtr<CalculationNode> {
static auto to_calculation_node = [calculation_context](CSSStyleValue const& value) -> NonnullRefPtr<CalculationNode const> {
switch (value.type()) {
case CSSStyleValue::Type::Angle:
return NumericCalculationNode::create(value.as_angle().angle(), calculation_context);
@ -566,7 +566,7 @@ NonnullRefPtr<CSSStyleValue const> interpolate_value(DOM::Element& element, Calc
auto interpolated_from = interpolate_value(element, calculation_context, from, from_base_type_and_default->default_value, delta);
auto interpolated_to = interpolate_value(element, calculation_context, to_base_type_and_default->default_value, to, delta);
Vector<NonnullRefPtr<CalculationNode>> values;
Vector<NonnullRefPtr<CalculationNode const>> values;
values.ensure_capacity(2);
values.unchecked_append(to_calculation_node(interpolated_from));
values.unchecked_append(to_calculation_node(interpolated_to));