mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +00:00
LibWeb/CSS: Simplify calculations after parsing them
If a calculation was simplified down to a single numeric node, then most of the time we can instead return a regular StyleValue, for example `calc(2px + 3px)` would be simplified down to a `5px` LengthStyleValue. This means that parse_calculated_value() can't return a CalculatedStyleValue directly, and its callers all have to handle non-calculated values as well as calculated ones. This simplification is reflected in the new test results. Serialization is not yet correct in all cases but we're closer than we were. :^)
This commit is contained in:
parent
39cefd7abf
commit
ee712bd98f
Notes:
github-actions[bot]
2025-01-30 18:32:52 +00:00
Author: https://github.com/AtkinsSJ
Commit: ee712bd98f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3383
15 changed files with 295 additions and 228 deletions
|
@ -2,14 +2,14 @@ Harness status: OK
|
|||
|
||||
Found 18 tests
|
||||
|
||||
16 Pass
|
||||
2 Fail
|
||||
17 Pass
|
||||
1 Fail
|
||||
Pass Default column-gap is 'normal'
|
||||
Pass column-gap accepts pixels
|
||||
Pass column-gap accepts em
|
||||
Pass column-gap accepts vw
|
||||
Pass column-gap accepts percentage
|
||||
Fail column-gap accepts calc()
|
||||
Pass column-gap accepts calc()
|
||||
Fail column-gap accepts calc() mixing fixed and percentage values
|
||||
Pass Initial column-gap is 'normal'
|
||||
Pass Initial column-gap is 'normal' 2
|
||||
|
|
|
@ -2,8 +2,8 @@ Harness status: OK
|
|||
|
||||
Found 26 tests
|
||||
|
||||
21 Pass
|
||||
5 Fail
|
||||
23 Pass
|
||||
3 Fail
|
||||
Pass Default gap is 'normal'
|
||||
Pass gap accepts pixels
|
||||
Pass gap accepts pixels 2
|
||||
|
@ -14,9 +14,9 @@ Pass gap accepts vw
|
|||
Pass gap accepts vw and vh
|
||||
Pass gap accepts percentage
|
||||
Pass gap accepts percentage 2
|
||||
Fail gap accepts calc()
|
||||
Pass gap accepts calc()
|
||||
Fail gap accepts calc() mixing fixed and percentage values
|
||||
Fail gap accepts calc() 2
|
||||
Pass gap accepts calc() 2
|
||||
Pass Initial gap is 'normal'
|
||||
Pass Initial gap is 'normal' 2
|
||||
Pass Initial inherited gap is 'normal'
|
||||
|
|
|
@ -2,14 +2,14 @@ Harness status: OK
|
|||
|
||||
Found 18 tests
|
||||
|
||||
16 Pass
|
||||
2 Fail
|
||||
17 Pass
|
||||
1 Fail
|
||||
Pass Default grid-column-gap is 'normal'
|
||||
Pass grid-column-gap accepts pixels
|
||||
Pass grid-column-gap accepts em
|
||||
Pass grid-column-gap accepts vw
|
||||
Pass grid-column-gap accepts percentage
|
||||
Fail grid-column-gap accepts calc()
|
||||
Pass grid-column-gap accepts calc()
|
||||
Fail grid-column-gap accepts calc() mixing fixed and percentage values
|
||||
Pass Initial grid-column-gap is 'normal'
|
||||
Pass Initial grid-column-gap is 'normal' 2
|
||||
|
|
|
@ -2,8 +2,8 @@ Harness status: OK
|
|||
|
||||
Found 26 tests
|
||||
|
||||
21 Pass
|
||||
5 Fail
|
||||
23 Pass
|
||||
3 Fail
|
||||
Pass Default grid-gap is 'normal'
|
||||
Pass grid-gap accepts pixels
|
||||
Pass grid-gap accepts pixels 2
|
||||
|
@ -14,9 +14,9 @@ Pass grid-gap accepts vw
|
|||
Pass grid-gap accepts vw and vh
|
||||
Pass grid-gap accepts percentage
|
||||
Pass grid-gap accepts percentage 2
|
||||
Fail grid-gap accepts calc()
|
||||
Pass grid-gap accepts calc()
|
||||
Fail grid-gap accepts calc() mixing fixed and percentage values
|
||||
Fail grid-gap accepts calc() 2
|
||||
Pass grid-gap accepts calc() 2
|
||||
Pass Initial grid-gap is 'normal'
|
||||
Pass Initial grid-gap is 'normal' 2
|
||||
Pass Initial inherited grid-gap is 'normal'
|
||||
|
|
|
@ -2,14 +2,14 @@ Harness status: OK
|
|||
|
||||
Found 18 tests
|
||||
|
||||
16 Pass
|
||||
2 Fail
|
||||
17 Pass
|
||||
1 Fail
|
||||
Pass Default grid-row-gap is 'normal'
|
||||
Pass grid-row-gap accepts pixels
|
||||
Pass grid-row-gap accepts em
|
||||
Pass grid-row-gap accepts vw
|
||||
Pass grid-row-gap accepts percentage
|
||||
Fail grid-row-gap accepts calc()
|
||||
Pass grid-row-gap accepts calc()
|
||||
Fail grid-row-gap accepts calc() mixing fixed and percentage values
|
||||
Pass Initial grid-row-gap is 'normal'
|
||||
Pass Initial grid-row-gap is 'normal' 2
|
||||
|
|
|
@ -2,14 +2,14 @@ Harness status: OK
|
|||
|
||||
Found 18 tests
|
||||
|
||||
16 Pass
|
||||
2 Fail
|
||||
17 Pass
|
||||
1 Fail
|
||||
Pass Default row-gap is 'normal'
|
||||
Pass row-gap accepts pixels
|
||||
Pass row-gap accepts em
|
||||
Pass row-gap accepts vw
|
||||
Pass row-gap accepts percentage
|
||||
Fail row-gap accepts calc()
|
||||
Pass row-gap accepts calc()
|
||||
Fail row-gap accepts calc() mixing fixed and percentage values
|
||||
Pass Initial row-gap is 'normal'
|
||||
Pass Initial row-gap is 'normal' 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue