mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Ensure all passed arguments are used when parsing math functions
This disallows things such as `log(1, foobar)` where we would previously just skip over `foobar` and parse this as `log(1)`
This commit is contained in:
parent
1977a976da
commit
d32f99b16f
Notes:
github-actions[bot]
2025-10-23 08:35:51 +00:00
Author: https://github.com/Calme1709
Commit: d32f99b16f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6544
Reviewed-by: https://github.com/AtkinsSJ ✅
2 changed files with 7 additions and 4 deletions
|
|
@ -417,6 +417,10 @@ RefPtr<CalculationNode const> Parser::parse_math_function(Function const& functi
|
|||
parameter_index++;
|
||||
});
|
||||
|
||||
function_generator.append(R"~~~(
|
||||
if (argument_index < arguments.size())
|
||||
return nullptr;
|
||||
)~~~");
|
||||
// Generate the call to the constructor
|
||||
function_generator.append(" return @name:titlecase@CalculationNode::create("sv);
|
||||
parameter_index = 0;
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@ Harness status: OK
|
|||
|
||||
Found 48 tests
|
||||
|
||||
46 Pass
|
||||
2 Fail
|
||||
48 Pass
|
||||
Pass e.style['opacity'] = "exp()" should not set the property value
|
||||
Pass e.style['opacity'] = "exp( )" should not set the property value
|
||||
Pass e.style['opacity'] = "exp(,)" should not set the property value
|
||||
|
|
@ -18,7 +17,7 @@ Pass e.style['opacity'] = "exp(1, , 2)" should not set the property value
|
|||
Pass e.style['opacity'] = "log()" should not set the property value
|
||||
Pass e.style['opacity'] = "log( )" should not set the property value
|
||||
Pass e.style['opacity'] = "log(,)" should not set the property value
|
||||
Fail e.style['opacity'] = "log(1, )" should not set the property value
|
||||
Pass e.style['opacity'] = "log(1, )" should not set the property value
|
||||
Pass e.style['opacity'] = "log(, 1)" should not set the property value
|
||||
Pass e.style['opacity'] = "log(1 + )" should not set the property value
|
||||
Pass e.style['opacity'] = "log(1 - )" should not set the property value
|
||||
|
|
@ -51,4 +50,4 @@ Pass e.style['opacity'] = "log(1, 0s)" should not set the property value
|
|||
Pass e.style['opacity'] = "log(1, 0deg)" should not set the property value
|
||||
Pass e.style['opacity'] = "log(1, 0Hz)" should not set the property value
|
||||
Pass e.style['opacity'] = "log(1, 0dpi)" should not set the property value
|
||||
Fail e.style['opacity'] = "log(1, 0fr)" should not set the property value
|
||||
Pass e.style['opacity'] = "log(1, 0fr)" should not set the property value
|
||||
Loading…
Add table
Add a link
Reference in a new issue