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:
Sam Atkins 2025-01-28 15:49:55 +00:00 committed by Andreas Kling
commit 39cefd7abf
Notes: github-actions[bot] 2025-01-30 18:32:58 +00:00
2 changed files with 12 additions and 8 deletions

View file

@ -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 {