mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +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 126 tests
|
||||
|
||||
122 Pass
|
||||
4 Fail
|
||||
124 Pass
|
||||
2 Fail
|
||||
Pass new DOMMatrix()
|
||||
Pass new DOMMatrix(undefined)
|
||||
Pass new DOMMatrix(new DOMMatrix())
|
||||
@@ -23,7 +23,7 @@ Pass new DOMMatrix(sequence) 6 elements
|
||||
Pass new DOMMatrix("scale(2) translateX(5px) translateY(5px)")
|
||||
Pass new DOMMatrix("scale(2, 2) translateX(5px) translateY(5px)")
|
||||
Pass new DOMMatrix("scale(2)translateX(5px)translateY(5px)")
|
||||
Fail new DOMMatrix("scale(2) translateX(calc(2 * 2.5px)) translateY(5px)")
|
||||
Pass new DOMMatrix("scale(2) translateX(calc(2 * 2.5px)) translateY(5px)")
|
||||
Pass new DOMMatrix("scale(2) translateX(5px) translateY(5px) rotate(5deg) rotate(-5deg)")
|
||||
Pass new DOMMatrix("translateX (5px)")
|
||||
Pass new DOMMatrix("scale(2 2) translateX(5) translateY(5)")
|
||||
@@ -86,7 +86,7 @@ Pass new DOMMatrixReadOnly(sequence) 6 elements
|
||||
Pass new DOMMatrixReadOnly("scale(2) translateX(5px) translateY(5px)")
|
||||
Pass new DOMMatrixReadOnly("scale(2, 2) translateX(5px) translateY(5px)")
|
||||
Pass new DOMMatrixReadOnly("scale(2)translateX(5px)translateY(5px)")
|
||||
Fail new DOMMatrixReadOnly("scale(2) translateX(calc(2 * 2.5px)) translateY(5px)")
|
||||
Pass new DOMMatrixReadOnly("scale(2) translateX(calc(2 * 2.5px)) translateY(5px)")
|
||||
Pass new DOMMatrixReadOnly("scale(2) translateX(5px) translateY(5px) rotate(5deg) rotate(-5deg)")
|
||||
Pass new DOMMatrixReadOnly("translateX (5px)")
|
||||
Pass new DOMMatrixReadOnly("scale(2 2) translateX(5) translateY(5)")
|
||||
|
||||
Reference in New Issue
Block a user