mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
LibWeb/CSS: Tell CalculationContext whether to treat numbers as integers
Calc simplification eventually produces a single style-value as its output. This extra context data will let us know whether a calculated number should be treated as a `<number>` or an `<integer>`, so that for example, `z-index: 12` and `z-index: calc(12)` both produce an `IntegerStyleValue` containing 12.
This commit is contained in:
parent
91831438e0
commit
39cefd7abf
Notes:
github-actions[bot]
2025-01-30 18:32:58 +00:00
Author: https://github.com/AtkinsSJ
Commit: 39cefd7abf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3383
2 changed files with 12 additions and 8 deletions
|
@ -28,6 +28,7 @@ class CalculationNode;
|
|||
// Contains the context available at parse-time.
|
||||
struct CalculationContext {
|
||||
Optional<ValueType> percentages_resolve_as {};
|
||||
bool resolve_numbers_as_integers = false;
|
||||
};
|
||||
// Contains the context for resolving the calculation.
|
||||
struct CalculationResolutionContext {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue