mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Check interpolatable to tell whether transition is created or not.
This commit is contained in:
parent
4771e6ea1e
commit
f6b8fb177c
1 changed files with 5 additions and 1 deletions
|
@ -1396,6 +1396,8 @@ impl<'le> TElement for GeckoElement<'le> {
|
|||
existing_transitions: &HashMap<TransitionProperty,
|
||||
Arc<AnimationValue>>)
|
||||
-> bool {
|
||||
use properties::animated_properties::Animatable;
|
||||
|
||||
// |property| should be an animatable longhand
|
||||
let animatable_longhand = AnimatableLonghand::from_transition_property(property).unwrap();
|
||||
|
||||
|
@ -1414,7 +1416,9 @@ impl<'le> TElement for GeckoElement<'le> {
|
|||
let to = AnimationValue::from_computed_values(&animatable_longhand,
|
||||
after_change_style);
|
||||
|
||||
combined_duration > 0.0f32 && from != to
|
||||
combined_duration > 0.0f32 &&
|
||||
from != to &&
|
||||
from.interpolate(&to, 0.5).is_ok()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue