mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 10:37:17 +02: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:
committed by
Andreas Kling
parent
39cefd7abf
commit
ee712bd98f
Notes:
github-actions[bot]
2025-01-30 18:32:52 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/ee712bd98f7 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3383
@@ -2,8 +2,8 @@ Harness status: OK
|
||||
|
||||
Found 12 tests
|
||||
|
||||
8 Pass
|
||||
4 Fail
|
||||
9 Pass
|
||||
3 Fail
|
||||
Pass Property flex-basis value '1px'
|
||||
Pass Property flex-basis value '400%'
|
||||
Pass Property flex-basis value 'auto'
|
||||
@@ -13,6 +13,6 @@ Pass Property flex-basis value 'min-content'
|
||||
Pass Property flex-basis value 'max-content'
|
||||
Fail Property flex-basis value 'calc(10px + 0.5em)'
|
||||
Fail Property flex-basis value 'calc(10px - 0.5em)'
|
||||
Fail Property flex-basis value 'calc(10%)'
|
||||
Pass Property flex-basis value 'calc(10%)'
|
||||
Pass Property flex-basis value 'calc(0% + 10px)'
|
||||
Fail Property flex-basis value 'calc(10% + 0px)'
|
||||
Reference in New Issue
Block a user