LibWeb/CSS: Implement calc-serialization spec algorithms

This gets us 37 new subtest passes in css/css-values, and 13 passes in
our other in-tree tests (and probably some random other ones!)

As noted in comments, a few parts of this algorithm have ad-hoc
behaviour to handle some issues in the spec.
This commit is contained in:
Sam Atkins 2025-02-26 14:08:20 +00:00 committed by Andreas Kling
commit a63879330f
Notes: github-actions[bot] 2025-02-27 20:43:46 +00:00
11 changed files with 412 additions and 54 deletions

View file

@ -2,15 +2,14 @@ Harness status: OK
Found 10 tests
8 Pass
2 Fail
10 Pass
Pass e.style['height'] = "auto" should set the property value
Pass e.style['height'] = "min-content" should set the property value
Pass e.style['height'] = "max-content" should set the property value
Pass e.style['height'] = "0" should set the property value
Pass e.style['height'] = "10%" should set the property value
Pass e.style['height'] = "0.5em" should set the property value
Fail e.style['height'] = "calc(10% - 0.5em)" should set the property value
Pass e.style['height'] = "calc(10% - 0.5em)" should set the property value
Pass e.style['height'] = "fit-content(10%)" should set the property value
Pass e.style['height'] = "fit-content(0.5em)" should set the property value
Fail e.style['height'] = "fit-content(calc(10% - 0.5em))" should set the property value
Pass e.style['height'] = "fit-content(calc(10% - 0.5em))" should set the property value

View file

@ -2,15 +2,14 @@ Harness status: OK
Found 10 tests
8 Pass
2 Fail
10 Pass
Pass e.style['max-height'] = "none" should set the property value
Pass e.style['max-height'] = "min-content" should set the property value
Pass e.style['max-height'] = "max-content" should set the property value
Pass e.style['max-height'] = "0" should set the property value
Pass e.style['max-height'] = "10%" should set the property value
Pass e.style['max-height'] = "0.5em" should set the property value
Fail e.style['max-height'] = "calc(10% - 0.5em)" should set the property value
Pass e.style['max-height'] = "calc(10% - 0.5em)" should set the property value
Pass e.style['max-height'] = "fit-content(10%)" should set the property value
Pass e.style['max-height'] = "fit-content(0.5em)" should set the property value
Fail e.style['max-height'] = "fit-content(calc(10% - 0.5em))" should set the property value
Pass e.style['max-height'] = "fit-content(calc(10% - 0.5em))" should set the property value

View file

@ -2,15 +2,14 @@ Harness status: OK
Found 10 tests
8 Pass
2 Fail
10 Pass
Pass e.style['max-width'] = "none" should set the property value
Pass e.style['max-width'] = "min-content" should set the property value
Pass e.style['max-width'] = "max-content" should set the property value
Pass e.style['max-width'] = "0" should set the property value
Pass e.style['max-width'] = "10%" should set the property value
Pass e.style['max-width'] = "0.5em" should set the property value
Fail e.style['max-width'] = "calc(10% - 0.5em)" should set the property value
Pass e.style['max-width'] = "calc(10% - 0.5em)" should set the property value
Pass e.style['max-width'] = "fit-content(10%)" should set the property value
Pass e.style['max-width'] = "fit-content(0.5em)" should set the property value
Fail e.style['max-width'] = "fit-content(calc(10% - 0.5em))" should set the property value
Pass e.style['max-width'] = "fit-content(calc(10% - 0.5em))" should set the property value

View file

@ -2,15 +2,14 @@ Harness status: OK
Found 10 tests
8 Pass
2 Fail
10 Pass
Pass e.style['min-height'] = "auto" should set the property value
Pass e.style['min-height'] = "min-content" should set the property value
Pass e.style['min-height'] = "max-content" should set the property value
Pass e.style['min-height'] = "0" should set the property value
Pass e.style['min-height'] = "10%" should set the property value
Pass e.style['min-height'] = "0.5em" should set the property value
Fail e.style['min-height'] = "calc(10% - 0.5em)" should set the property value
Pass e.style['min-height'] = "calc(10% - 0.5em)" should set the property value
Pass e.style['min-height'] = "fit-content(10%)" should set the property value
Pass e.style['min-height'] = "fit-content(0.5em)" should set the property value
Fail e.style['min-height'] = "fit-content(calc(10% - 0.5em))" should set the property value
Pass e.style['min-height'] = "fit-content(calc(10% - 0.5em))" should set the property value

View file

@ -2,15 +2,14 @@ Harness status: OK
Found 10 tests
8 Pass
2 Fail
10 Pass
Pass e.style['min-width'] = "auto" should set the property value
Pass e.style['min-width'] = "min-content" should set the property value
Pass e.style['min-width'] = "max-content" should set the property value
Pass e.style['min-width'] = "0" should set the property value
Pass e.style['min-width'] = "10%" should set the property value
Pass e.style['min-width'] = "0.5em" should set the property value
Fail e.style['min-width'] = "calc(10% - 0.5em)" should set the property value
Pass e.style['min-width'] = "calc(10% - 0.5em)" should set the property value
Pass e.style['min-width'] = "fit-content(10%)" should set the property value
Pass e.style['min-width'] = "fit-content(0.5em)" should set the property value
Fail e.style['min-width'] = "fit-content(calc(10% - 0.5em))" should set the property value
Pass e.style['min-width'] = "fit-content(calc(10% - 0.5em))" should set the property value

View file

@ -2,15 +2,14 @@ Harness status: OK
Found 10 tests
8 Pass
2 Fail
10 Pass
Pass e.style['width'] = "auto" should set the property value
Pass e.style['width'] = "min-content" should set the property value
Pass e.style['width'] = "max-content" should set the property value
Pass e.style['width'] = "0" should set the property value
Pass e.style['width'] = "10%" should set the property value
Pass e.style['width'] = "0.5em" should set the property value
Fail e.style['width'] = "calc(10% - 0.5em)" should set the property value
Pass e.style['width'] = "calc(10% - 0.5em)" should set the property value
Pass e.style['width'] = "fit-content(10%)" should set the property value
Pass e.style['width'] = "fit-content(0.5em)" should set the property value
Fail e.style['width'] = "fit-content(calc(10% - 0.5em))" should set the property value
Pass e.style['width'] = "fit-content(calc(10% - 0.5em))" should set the property value