Sample CSS animation property tracks

This commit is contained in:
SGavrl committed 2026-08-03 15:10:41 +00:00
1 parent 642b6b57b5
commit 8754da5804
3 files changed
+1232 -133

No files matched your search

File diff suppressed because it is too large. Load diff
+15
View File
@@ -495,6 +495,14 @@ impl BackgroundPositionAxis {
pub fn resolve(self, leftover_space: f32) -> f32 { pub fn resolve(self, leftover_space: f32) -> f32 {
self.length + self.percentage * leftover_space self.length + self.percentage * leftover_space
} }
pub(crate) fn interpolate(self, other: Self, position: f32) -> Self {
Self {
length: self.length + (other.length - self.length) * position,
percentage: self.percentage
+ (other.percentage - self.percentage) * position,
}
}
} }
/// The two axes of CSS `background-position`. /// The two axes of CSS `background-position`.
@@ -511,6 +519,13 @@ impl BackgroundPosition {
pub const fn new(x: BackgroundPositionAxis, y: BackgroundPositionAxis) -> Self { pub const fn new(x: BackgroundPositionAxis, y: BackgroundPositionAxis) -> Self {
Self { x, y } Self { x, y }
} }
pub(crate) fn interpolate(self, other: Self, position: f32) -> Self {
Self {
x: self.x.interpolate(other.x, position),
y: self.y.interpolate(other.y, position),
}
}
} }
/// Fill rule for a CSS `clip-path: polygon(...)`. /// Fill rule for a CSS `clip-path: polygon(...)`.
+11
View File
@@ -354,6 +354,17 @@ pub(crate) fn apply_animation_declarations(style: &mut LayoutStyle, css: &str) {
} }
} }
/// Apply one already-cascaded keyframe declaration through the ordinary
/// computed-style parser. The animation sampler deliberately reuses this
/// path instead of maintaining a second, subtly different value parser.
pub(crate) fn apply_animation_property_value(
style: &mut LayoutStyle,
name: &str,
value: &str,
) {
apply_value(style, name, value);
}
fn apply_color_scheme( fn apply_color_scheme(
style: &mut LayoutStyle, style: &mut LayoutStyle,
value: &str, value: &str,