LibWeb/CSS: Replace resolve_length_deprecated() with resolve_length()

This commit is contained in:
Sam Atkins 2025-09-24 14:33:18 +01:00 committed by Tim Ledbetter
parent 995b7eb7b4
commit 0314606c73
5 changed files with 4 additions and 13 deletions

View File

@ -60,7 +60,7 @@ NonnullRefPtr<StyleValue const> IntegerOrCalculated::create_style_value() const
Optional<Length> LengthOrCalculated::resolve_calculated(NonnullRefPtr<CalculatedStyleValue const> const& calculated, CalculationResolutionContext const& context) const
{
return calculated->resolve_length_deprecated(context);
return calculated->resolve_length(context);
}
NonnullRefPtr<StyleValue const> LengthOrCalculated::create_style_value() const

View File

@ -546,7 +546,7 @@ Length ComputedProperties::border_spacing_horizontal(Layout::Node const& layout_
if (style_value.is_length())
return style_value.as_length().length();
if (style_value.is_calculated())
return style_value.as_calculated().resolve_length_deprecated({ .length_resolution_context = Length::ResolutionContext::for_layout_node(layout_node) }).value_or(Length::make_px(0));
return style_value.as_calculated().resolve_length({ .length_resolution_context = Length::ResolutionContext::for_layout_node(layout_node) }).value_or(Length::make_px(0));
return {};
};
@ -568,7 +568,7 @@ Length ComputedProperties::border_spacing_vertical(Layout::Node const& layout_no
if (style_value.is_length())
return style_value.as_length().length();
if (style_value.is_calculated())
return style_value.as_calculated().resolve_length_deprecated({ .length_resolution_context = Length::ResolutionContext::for_layout_node(layout_node) }).value_or(Length::make_px(0));
return style_value.as_calculated().resolve_length({ .length_resolution_context = Length::ResolutionContext::for_layout_node(layout_node) }).value_or(Length::make_px(0));
return {};
};

View File

@ -3011,14 +3011,6 @@ Optional<Frequency> CalculatedStyleValue::resolve_frequency(CalculationResolutio
return {};
}
Optional<Length> CalculatedStyleValue::resolve_length_deprecated(CalculationResolutionContext const& context) const
{
auto result = m_calculation->resolve(context);
if (result.type().has_value() && result.type()->matches_length(m_context.percentages_resolve_as))
return Length::make_px(result.value());
return {};
}
Optional<Length> CalculatedStyleValue::resolve_length(CalculationResolutionContext const& context) const
{
auto result = resolve_value(context);

View File

@ -88,7 +88,6 @@ public:
bool resolves_to_length() const { return m_resolved_type.matches_length(m_context.percentages_resolve_as); }
bool resolves_to_length_percentage() const { return m_resolved_type.matches_length_percentage(m_context.percentages_resolve_as); }
Optional<Length> resolve_length_deprecated(CalculationResolutionContext const&) const;
Optional<Length> resolve_length(CalculationResolutionContext const&) const;
bool resolves_to_percentage() const { return m_resolved_type.matches_percentage(); }

View File

@ -556,7 +556,7 @@ void LayoutState::UsedValues::set_node(NodeWithStyle const& node, UsedValues con
auto containing_block_size_as_length = width ? containing_block_used_values->content_width() : containing_block_used_values->content_height();
context.percentage_basis = CSS::Length::make_px(containing_block_size_as_length);
}
resolved_definite_size = clamp_to_max_dimension_value(adjust_for_box_sizing(size.calculated().resolve_length_deprecated(context)->to_px(node), size, width));
resolved_definite_size = clamp_to_max_dimension_value(adjust_for_box_sizing(size.calculated().resolve_length(context)->to_px(node), size, width));
return true;
}