LibWeb: Discard Number type when converting to CalculationNode

Before this change we would maintain explicit signs when serializing
e.g. `animation-iteration-count: calc(+1)` would serialize as `calc(+1)`
rather than `calc(1)` as intended
This commit is contained in:
Callum Law 2025-10-10 00:55:13 +13:00 committed by Sam Atkins
commit ef4f01ea44
Notes: github-actions[bot] 2025-10-20 10:29:27 +00:00

View file

@ -4253,7 +4253,7 @@ RefPtr<CalculationNode const> Parser::convert_to_calculation_node(CalcParsing::N
}
if (component_value->is(Token::Type::Number))
return NumericCalculationNode::create(component_value->token().number(), context);
return NumericCalculationNode::create(Number { Number::Type::Number, component_value->token().number().value() }, context);
if (component_value->is(Token::Type::Dimension)) {
auto numeric_value = component_value->token().dimension_value();