mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-23 08:30:50 +00:00
LibWeb: Support tree counting functions within calc()
This commit is contained in:
parent
55bcdcf824
commit
e9036c7c75
Notes:
github-actions[bot]
2025-10-20 15:13:31 +00:00
Author: https://github.com/Calme1709
Commit: e9036c7c75
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6426
Reviewed-by: https://github.com/AtkinsSJ ✅
15 changed files with 62 additions and 44 deletions
|
@ -4314,6 +4314,10 @@ RefPtr<CalculationNode const> Parser::convert_to_calculation_node(CalcParsing::N
|
|||
if (component_value->is(Token::Type::Percentage))
|
||||
return NumericCalculationNode::create(Percentage { component_value->token().percentage() }, context);
|
||||
|
||||
auto tree_counting_function_tokens = TokenStream<ComponentValue>::of_single_token(component_value);
|
||||
if (auto tree_counting_function = parse_tree_counting_function(tree_counting_function_tokens, TreeCountingFunctionStyleValue::ComputedType::Number))
|
||||
return NonMathFunctionCalculationNode::create(tree_counting_function.release_nonnull(), NumericType {});
|
||||
|
||||
// NOTE: If we get here, then we have a ComponentValue that didn't get replaced with something else,
|
||||
// so the calc() is invalid.
|
||||
ErrorReporter::the().report(InvalidValueError {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue