Commit graph

15 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
Callum Law
0e30de82cc LibWeb: Implement <step-position> as an enum
This simplifies parsing and serialization by using the generated
functions
2025-10-20 11:27:44 +01:00
Sam Atkins
aa8bf6372f LibWeb/CSS: Inline EasingStyleValue::CubicBezier::operator==()
For whatever reason, this method in particular ends up failing to link
into WebContent with a subsequent change. It's small and simple, so
just inline it.
2025-09-26 22:31:07 +02:00
Callum Law
011ab5f714 LibWeb: Use correct SerializationMode when serializing CalculatedOr 2025-08-06 17:44:12 +01:00
Tim Ledbetter
fa1e02e5d7 LibWeb: Allow calc() values in cubic-bezier() easing functions 2025-06-18 08:57:06 +02:00
Tim Ledbetter
c5a3eaaf45 LibWeb: Allow calc() values in steps() easing functions 2025-06-18 08:57:06 +02:00
Veeti Paananen
21b531598d LibWeb/CSS: Fix reference bug when canonicalizing linear easing stops
+2 WPT tests
2025-06-18 08:53:10 +02:00
Pavel Shliak
8cd514d83c LibWeb: Correct serialization of steps() easing functions 2024-11-18 17:39:03 -05:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Renamed from Userland/Libraries/LibWeb/CSS/StyleValues/EasingStyleValue.cpp (Browse further)