mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-17 13:39:25 +00:00
LibWeb/CSS: Replace resolve_time_deprecated() with resolve_time()
This commit is contained in:
parent
7428a8eb40
commit
0ff012d3f3
Notes:
github-actions[bot]
2025-09-24 15:36:45 +00:00
Author: https://github.com/AtkinsSJ
Commit: 0ff012d3f3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6290
Reviewed-by: https://github.com/tcl3 ✅
4 changed files with 2 additions and 11 deletions
|
@ -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
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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); }
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue