LibWeb: Handle NaN and Infinite values in CSS round function

Gains us 10 WPT tests
This commit is contained in:
Callum Law
2025-06-27 02:35:07 +12:00
committed by Sam Atkins
parent 376b992f0e
commit 4ba54a7a1c
Notes: github-actions[bot] 2025-08-08 10:45:07 +00:00
3 changed files with 59 additions and 10 deletions

View File

@@ -2,8 +2,8 @@ Harness status: OK
Found 229 tests
211 Pass
18 Fail
215 Pass
14 Fail
Pass round(10,10) should be used-value-equivalent to 10
Pass mod(1,1) should be used-value-equivalent to 0
Pass rem(1,1) should be used-value-equivalent to 0
@@ -217,18 +217,18 @@ Pass round(to-zero, 0, -Infinity) should be used-value-equivalent to 0
Pass round(to-zero, 4, -Infinity) should be used-value-equivalent to 0
Pass round(to-zero, -0, -Infinity) should be used-value-equivalent to calc(-0)
Pass round(to-zero, -4, -Infinity) should be used-value-equivalent to calc(-0)
Fail round(up, 1, Infinity) should be used-value-equivalent to calc(Infinity)
Pass round(up, 1, Infinity) should be used-value-equivalent to calc(Infinity)
Pass round(up, 0, Infinity) should be used-value-equivalent to 0
Pass round(up, -1, Infinity) should be used-value-equivalent to calc(-0)
Fail round(up, 1, -Infinity) should be used-value-equivalent to calc(Infinity)
Pass round(up, 1, -Infinity) should be used-value-equivalent to calc(Infinity)
Pass round(up, 0, -Infinity) should be used-value-equivalent to 0
Pass round(up, -1, -Infinity) should be used-value-equivalent to calc(-0)
Pass round(down, 1, Infinity) should be used-value-equivalent to calc(-0)
Pass round(down, 0, Infinity) should be used-value-equivalent to 0
Fail round(down, -1, Infinity) should be used-value-equivalent to calc(-Infinity)
Pass round(down, -1, Infinity) should be used-value-equivalent to calc(-Infinity)
Pass round(down, 1, -Infinity) should be used-value-equivalent to calc(-0)
Pass round(down, 0, -Infinity) should be used-value-equivalent to 0
Fail round(down, -1, -Infinity) should be used-value-equivalent to calc(-Infinity)
Pass round(down, -1, -Infinity) should be used-value-equivalent to calc(-Infinity)
Pass mod(-0, Infinity) should be used-value-equivalent to calc(NaN)
Pass mod(0, -Infinity) should be used-value-equivalent to calc(NaN)
Pass mod(-4, Infinity) should be used-value-equivalent to calc(NaN)