LibWeb/CSS: Remove an ad-hoc simplification step in calc() parsing

This commit is contained in:
Lucas CHOLLET 2025-02-27 15:25:21 -07:00 committed by Sam Atkins
parent 715bf0de2c
commit 4bf197872b
Notes: github-actions[bot] 2025-03-05 12:06:57 +00:00
10 changed files with 84 additions and 92 deletions

View file

@ -3248,12 +3248,6 @@ RefPtr<CSSStyleValue> Parser::parse_calculated_value(ComponentValue const& compo
if (!function_node)
return nullptr;
// If the calculation got simplified down to a single value, return that instead.
if (function_node->type() == CalculationNode::Type::Numeric) {
if (auto number_value = as<NumericCalculationNode>(*function_node).to_style_value(context))
return number_value.release_nonnull();
}
auto function_type = function_node->numeric_type();
if (!function_type.has_value())
return nullptr;