LibWeb: Mark CalculatedStyleValue::resolve_* methods as deprecated

The existing resolve methods are not to spec and we are working to
replace them with new ones based on the `simplify_a_calculation_tree`
method.

These are marked as deprecated rather than replaced outright as work
will need to be done on the caller side to be made compatible with the
new methods, for instance the new methods can fail to resolve (e.g.
if we are missing required context), where the existing methods will
always resolve (albeit sometimes with an incorrect value).

No functionality changes.
This commit is contained in:
Callum Law 2025-07-02 19:12:33 +12:00 committed by Sam Atkins
commit afa95c2815
Notes: github-actions[bot] 2025-07-16 12:06:57 +00:00
22 changed files with 69 additions and 70 deletions

View file

@ -363,7 +363,7 @@ Optional<Ratio> Parser::parse_ratio(TokenStream<ComponentValue>& tokens)
return maybe_calc->as_number().value();
if (!maybe_calc->is_calculated() || !maybe_calc->as_calculated().resolves_to_number())
return {};
if (auto resolved_number = maybe_calc->as_calculated().resolve_number({}); resolved_number.has_value() && resolved_number.value() >= 0) {
if (auto resolved_number = maybe_calc->as_calculated().resolve_number_deprecated({}); resolved_number.has_value() && resolved_number.value() >= 0) {
return resolved_number.value();
}
}