Introduce values::animated::Animate

This replaces the Animatable trait and merges its three former methods into a single one.
This commit is contained in:
Anthony Ramine 2017-08-17 16:38:08 +02:00
parent 0cceeb9d5c
commit aea0cd7ec7
23 changed files with 876 additions and 937 deletions

View file

@ -1401,15 +1401,15 @@ impl<'le> TElement for GeckoElement<'le> {
})
}
fn needs_transitions_update_per_property(&self,
property: &TransitionProperty,
combined_duration: f32,
before_change_style: &ComputedValues,
after_change_style: &ComputedValues,
existing_transitions: &HashMap<TransitionProperty,
Arc<AnimationValue>>)
-> bool {
use properties::animated_properties::Animatable;
fn needs_transitions_update_per_property(
&self,
property: &TransitionProperty,
combined_duration: f32,
before_change_style: &ComputedValues,
after_change_style: &ComputedValues,
existing_transitions: &HashMap<TransitionProperty, Arc<AnimationValue>>,
) -> bool {
use values::animated::{Animate, Procedure};
// |property| should be an animatable longhand
let animatable_longhand = AnimatableLonghand::from_transition_property(property).unwrap();
@ -1431,7 +1431,7 @@ impl<'le> TElement for GeckoElement<'le> {
combined_duration > 0.0f32 &&
from != to &&
from.interpolate(&to, 0.5).is_ok()
from.animate(&to, Procedure::Interpolate { progress: 0.5 }).is_ok()
}
#[inline]