LibWeb/CSS: Replace resolve_time_deprecated() with resolve_time()

This commit is contained in:
Sam Atkins 2025-09-24 13:57:37 +01:00 committed by Tim Ledbetter
commit 0ff012d3f3
Notes: github-actions[bot] 2025-09-24 15:36:45 +00:00
4 changed files with 2 additions and 11 deletions

View file

@ -126,7 +126,7 @@ NonnullRefPtr<StyleValue const> ResolutionOrCalculated::create_style_value() con
Optional<Time> TimeOrCalculated::resolve_calculated(NonnullRefPtr<CalculatedStyleValue const> const& calculated, CalculationResolutionContext const& context) const Optional<Time> TimeOrCalculated::resolve_calculated(NonnullRefPtr<CalculatedStyleValue const> const& calculated, CalculationResolutionContext const& context) const
{ {
return calculated->resolve_time_deprecated(context); return calculated->resolve_time(context);
} }
NonnullRefPtr<StyleValue const> TimeOrCalculated::create_style_value() const NonnullRefPtr<StyleValue const> TimeOrCalculated::create_style_value() const

View file

@ -3057,14 +3057,6 @@ Optional<Resolution> CalculatedStyleValue::resolve_resolution(CalculationResolut
return {}; return {};
} }
Optional<Time> CalculatedStyleValue::resolve_time_deprecated(CalculationResolutionContext const& context) const
{
auto result = m_calculation->resolve(context);
if (result.type().has_value() && result.type()->matches_time(m_context.percentages_resolve_as))
return Time::make_seconds(result.value());
return {};
}
Optional<Time> CalculatedStyleValue::resolve_time(CalculationResolutionContext const& context) const Optional<Time> CalculatedStyleValue::resolve_time(CalculationResolutionContext const& context) const
{ {
auto result = resolve_value(context); auto result = resolve_value(context);

View file

@ -100,7 +100,6 @@ public:
bool resolves_to_time() const { return m_resolved_type.matches_time(m_context.percentages_resolve_as); } bool resolves_to_time() const { return m_resolved_type.matches_time(m_context.percentages_resolve_as); }
bool resolves_to_time_percentage() const { return m_resolved_type.matches_time_percentage(m_context.percentages_resolve_as); } bool resolves_to_time_percentage() const { return m_resolved_type.matches_time_percentage(m_context.percentages_resolve_as); }
Optional<Time> resolve_time_deprecated(CalculationResolutionContext const&) const;
Optional<Time> resolve_time(CalculationResolutionContext const&) const; Optional<Time> resolve_time(CalculationResolutionContext const&) const;
bool resolves_to_number() const { return m_resolved_type.matches_number(m_context.percentages_resolve_as); } bool resolves_to_number() const { return m_resolved_type.matches_number(m_context.percentages_resolve_as); }

View file

@ -696,7 +696,7 @@ void NodeWithStyle::apply_style(CSS::ComputedProperties const& computed_style)
computed_values.set_transition_delay(transition_delay.time()); computed_values.set_transition_delay(transition_delay.time());
} else if (transition_delay_property.is_calculated()) { } else if (transition_delay_property.is_calculated()) {
auto const& transition_delay = transition_delay_property.as_calculated(); auto const& transition_delay = transition_delay_property.as_calculated();
computed_values.set_transition_delay(transition_delay.resolve_time_deprecated({ .length_resolution_context = CSS::Length::ResolutionContext::for_layout_node(*this) }).value()); computed_values.set_transition_delay(transition_delay.resolve_time({ .length_resolution_context = CSS::Length::ResolutionContext::for_layout_node(*this) }).value());
} }
auto do_border_style = [&](CSS::BorderData& border, CSS::PropertyID width_property, CSS::PropertyID color_property, CSS::PropertyID style_property) { auto do_border_style = [&](CSS::BorderData& border, CSS::PropertyID width_property, CSS::PropertyID color_property, CSS::PropertyID style_property) {