LibWeb/CSS: Resolve calc percentages as lengths in basic-shape functions

Fixes a crash on https://www.lego.com/en-gb/product/game-boy-72046 :^)

The apparent regressions in clip-path-interpolation-xywh-rect.html are
because of false positives. Something about the test was causing it to
compare two wrong values that happened to be the same. Now one of the
values is correct, they don't match.
This commit is contained in:
Sam Atkins
2025-11-13 17:13:58 +00:00
parent d98cc50736
commit 48854a8e74
Notes: github-actions[bot] 2025-11-14 11:33:55 +00:00
10 changed files with 78 additions and 70 deletions

View File

@@ -2,14 +2,14 @@ Harness status: OK
Found 14 tests
4 Pass
10 Fail
5 Pass
9 Fail
Fail Property shape-outside value 'circle()'
Fail Property shape-outside value 'circle(1px)'
Pass Property shape-outside value 'circle(20px at center)'
Fail Property shape-outside value 'circle(at 10% 20%)'
Pass Property shape-outside value 'circle(4% at top right)'
Fail Property shape-outside value 'circle(calc(100% - 20px) at calc(100% - 20px) calc(100% / 4))'
Pass Property shape-outside value 'circle(calc(100% - 20px) at calc(100% - 20px) calc(100% / 4))'
Fail Property shape-outside value 'circle(closest-corner at center)'
Fail Property shape-outside value 'circle(closest-corner at 20px 50px)'
Fail Property shape-outside value 'circle(closest-side at center)'

View File

@@ -2,13 +2,14 @@ Harness status: OK
Found 14 tests
14 Fail
1 Pass
13 Fail
Fail e.style['shape-outside'] = "circle()" should set the property value
Fail e.style['shape-outside'] = "circle(1px)" should set the property value
Fail e.style['shape-outside'] = "circle(20px at center)" should set the property value
Fail e.style['shape-outside'] = "circle(at 10% 20%)" should set the property value
Fail e.style['shape-outside'] = "circle(4% at top right)" should set the property value
Fail e.style['shape-outside'] = "circle(calc(100% - 20px) at calc(100% - 20px) calc(100% / 4))" should set the property value
Pass e.style['shape-outside'] = "circle(calc(100% - 20px) at calc(100% - 20px) calc(100% / 4))" should set the property value
Fail e.style['shape-outside'] = "circle(closest-corner at center)" should set the property value
Fail e.style['shape-outside'] = "circle(closest-corner at 20px 50px)" should set the property value
Fail e.style['shape-outside'] = "circle(closest-side at center)" should set the property value

View File

@@ -2,8 +2,8 @@ Harness status: OK
Found 14 tests
5 Pass
9 Fail
6 Pass
8 Fail
Fail Property shape-outside value 'ellipse()'
Fail Property shape-outside value 'ellipse(1px 2px)'
Pass Property shape-outside value 'ellipse(20px 40px at center)'
@@ -14,7 +14,7 @@ Fail Property shape-outside value 'ellipse(farthest-corner 20%)'
Fail Property shape-outside value 'ellipse(at 10% 20%)'
Fail Property shape-outside value 'ellipse(at -10px -20%)'
Pass Property shape-outside value 'ellipse(4% 20% at top right)'
Fail Property shape-outside value 'ellipse(calc(100% - 20px) calc(80% - 10px) at calc(100% - 20px) calc(100% / 4))'
Pass Property shape-outside value 'ellipse(calc(100% - 20px) calc(80% - 10px) at calc(100% - 20px) calc(100% / 4))'
Pass Property shape-outside value 'ellipse(10px closest-side at top right)'
Pass Property shape-outside value 'ellipse(farthest-side 20px at center top)'
Pass Property shape-outside value 'ellipse(farthest-side farthest-side at top right)'

View File

@@ -2,7 +2,8 @@ Harness status: OK
Found 14 tests
14 Fail
1 Pass
13 Fail
Fail e.style['shape-outside'] = "ellipse()" should set the property value
Fail e.style['shape-outside'] = "ellipse(1px 2px)" should set the property value
Fail e.style['shape-outside'] = "ellipse(20px 40px at center)" should set the property value
@@ -13,7 +14,7 @@ Fail e.style['shape-outside'] = "ellipse(farthest-corner 20%)" should set the pr
Fail e.style['shape-outside'] = "ellipse(at 10% 20%)" should set the property value
Fail e.style['shape-outside'] = "ellipse(at -10px -20%)" should set the property value
Fail e.style['shape-outside'] = "ellipse(4% 20% at top right)" should set the property value
Fail e.style['shape-outside'] = "ellipse(calc(100% - 20px) calc(80% - 10px) at calc(100% - 20px) calc(100% / 4))" should set the property value
Pass e.style['shape-outside'] = "ellipse(calc(100% - 20px) calc(80% - 10px) at calc(100% - 20px) calc(100% / 4))" should set the property value
Fail e.style['shape-outside'] = "ellipse(10px closest-side at top right)" should set the property value
Fail e.style['shape-outside'] = "ellipse(farthest-side 20px at center top)" should set the property value
Fail e.style['shape-outside'] = "ellipse(farthest-side farthest-side at top right)" should set the property value

View File

@@ -2,14 +2,14 @@ Harness status: OK
Found 11 tests
1 Pass
10 Fail
2 Pass
9 Fail
Fail e.style['shape-outside'] = "inset(100%)" should set the property value
Fail e.style['shape-outside'] = "inset(0 1px)" should set the property value
Fail e.style['shape-outside'] = "inset(0px 1px 2%)" should set the property value
Fail e.style['shape-outside'] = "inset(-20px -20px 2%)" should set the property value
Pass e.style['shape-outside'] = "inset(0px 1px 2% 3em)" should set the property value
Fail e.style['shape-outside'] = "inset(0px calc(100% - 20px) 2% 3em)" should set the property value
Pass e.style['shape-outside'] = "inset(0px calc(100% - 20px) 2% 3em)" should set the property value
Fail e.style['shape-outside'] = "inset(0px round 100%)" should set the property value
Fail e.style['shape-outside'] = "inset(0px round 0 1px)" should set the property value
Fail e.style['shape-outside'] = "inset(0px round 0px 1px 2%)" should set the property value

View File

@@ -2,10 +2,10 @@ Harness status: OK
Found 7 tests
1 Pass
6 Fail
2 Pass
5 Fail
Pass e.style['shape-outside'] = "xywh(0px 1px 2% 3em)" should set the property value
Fail e.style['shape-outside'] = "xywh(0px calc(100% - 20px) 2% 3em)" should set the property value
Pass e.style['shape-outside'] = "xywh(0px calc(100% - 20px) 2% 3em)" should set the property value
Fail e.style['shape-outside'] = "xywh(10px 20px 30px 25px round 100%)" should set the property value
Fail e.style['shape-outside'] = "xywh(10px 20px 30px 25px round 0 1px)" should set the property value
Fail e.style['shape-outside'] = "xywh(10px 20px 30px 25px round 0px 1px 2%)" should set the property value