Commit graph

7 commits

Author SHA1 Message Date
Callum Law
03be70087d LibWeb: Maintain easing keywords as KeywordStyleValue until use-time
This excludes `step-end` and `step-start` which are expected to be
converted to the equivalent function at parse time.

We are expected to serialize these as the explicit keywords - previously
we would parse as `EasingStyleValue` and serialize equivalent functions
as the keywords. This caused issues as we would incorrectly serialize
even explicit functions as the keyword.

This also allows us to move the magic easing functions to
`EasingFunction` rather than `EasingStyleValue` which is a bit tidier
2025-10-20 11:27:44 +01:00
Callum Law
755a576013 LibWeb: Support relative lengths within easing function calc()s 2025-10-20 11:27:44 +01:00
Callum Law
ad41f053b8 LibWeb: Clamp calculated steps() interval count using normal system
Previously we were doing this ad-hoc later in the process but we now
have the `calc` clamping system which can simplify things.

This reveals some false-positives in that we don't handle relative
lengths within these `calc`s but these are fixed in the next commit
2025-10-20 11:27:44 +01:00
Callum Law
06a57a280d LibWeb: Clamp calculated cubic-bezier() X coords using normal system
Previously we were doing this ad-hoc later in the process but we now
have the `calc` clamping system which can simplify things
2025-10-20 11:27:44 +01:00
Callum Law
2f83356c0f LibWeb: Support calc within linear() easing function 2025-10-20 11:27:44 +01:00
Callum Law
91925db9ca LibWeb: Don't canonicalize linear easing function points until use time
Canonicalization can require information that is only known after
compute time (i.e. resolved relative lengths within calcs).

This also allows us to get rid of the `had_explicit_input` flag and just
rely on whether Optional has a value
2025-10-20 11:27:44 +01:00
Callum Law
95e26819d9 LibWeb: Separate use time easing functions from EasingStyleValue
In the future there will be different methods of creating these use-time
easing functions (e.g. from `KeywordStyleValue`s)
2025-10-20 11:27:44 +01:00