mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Share computed animation-iteration-count representation between Servo and Gecko
This removes the special AnimationIterationCount -> f32 conversion from gecko.mako.rs which will be useful to simplify coordinated properties. Differential Revision: https://phabricator.services.mozilla.com/D167123
This commit is contained in:
parent
fa297196ef
commit
b96f8f748c
5 changed files with 67 additions and 73 deletions
|
@ -26,7 +26,6 @@ use crate::stylesheets::keyframes_rule::{KeyframesAnimation, KeyframesStep, Keyf
|
|||
use crate::stylesheets::layer_rule::LayerOrder;
|
||||
use crate::values::animated::{Animate, Procedure};
|
||||
use crate::values::computed::{Time, TimingFunction};
|
||||
use crate::values::generics::box_::AnimationIterationCount;
|
||||
use crate::values::generics::easing::BeforeFlag;
|
||||
use crate::Atom;
|
||||
use fxhash::FxHashMap;
|
||||
|
@ -1338,9 +1337,11 @@ pub fn maybe_start_animations<E>(
|
|||
// animation begins in a finished state.
|
||||
let delay = style.animation_delay_mod(i).seconds();
|
||||
|
||||
let iteration_state = match style.animation_iteration_count_mod(i) {
|
||||
AnimationIterationCount::Infinite => KeyframesIterationState::Infinite(0.0),
|
||||
AnimationIterationCount::Number(n) => KeyframesIterationState::Finite(0.0, n.into()),
|
||||
let iteration_count = style.animation_iteration_count_mod(i);
|
||||
let iteration_state = if iteration_count.0.is_infinite() {
|
||||
KeyframesIterationState::Infinite(0.0)
|
||||
} else {
|
||||
KeyframesIterationState::Finite(0.0, iteration_count.0 as f64)
|
||||
};
|
||||
|
||||
let animation_direction = style.animation_direction_mod(i);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue