Sample CSS animation property tracks
This commit is contained in:
1 parent
642b6b57b5
commit
8754da5804
3 files changed
+1232
-133
No files matched your search
+1206
-133
File diff suppressed because it is too large.
Load diff
@@ -495,6 +495,14 @@ impl BackgroundPositionAxis {
|
||||
pub fn resolve(self, leftover_space: f32) -> f32 {
|
||||
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`.
|
||||
@@ -511,6 +519,13 @@ impl BackgroundPosition {
|
||||
pub const fn new(x: BackgroundPositionAxis, y: BackgroundPositionAxis) -> Self {
|
||||
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(...)`.
|
||||
|
||||
@@ -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(
|
||||
style: &mut LayoutStyle,
|
||||
value: &str,
|
||||
|
||||
Reference in new issue
Block a user