LibWeb/CSS: Migrate some call sites to non-deprecated resolve_* methods

This ensures that we clamp values for properties like padding-* to valid
ranges (non-negative in this case) if they are specified with `calc()`.

The length-related changes in this commit combined with the ones from
the previous commit fix the primary layout issue on https://lwn.net
(yes, not the first place I would have expected problems either).
This commit is contained in:
InvalidUsernameException 2025-09-05 16:22:17 +02:00 committed by Sam Atkins
commit b057bad102
Notes: github-actions[bot] 2025-09-07 14:56:24 +00:00
7 changed files with 55 additions and 34 deletions

View file

@ -79,12 +79,11 @@ Optional<Frequency::Type> Frequency::unit_from_name(StringView name)
Frequency Frequency::resolve_calculated(NonnullRefPtr<CalculatedStyleValue const> const& calculated, Layout::Node const& layout_node, Frequency const& reference_value)
{
return calculated->resolve_frequency_deprecated(
{
.percentage_basis = reference_value,
.length_resolution_context = Length::ResolutionContext::for_layout_node(layout_node),
})
.value();
CalculationResolutionContext context {
.percentage_basis = reference_value,
.length_resolution_context = Length::ResolutionContext::for_layout_node(layout_node),
};
return calculated->resolve_frequency(context).value();
}
}