mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Don't calculate animations just on style changes.
Calculate it also on the first restyle.
This commit is contained in:
parent
8527762b83
commit
f149d4d577
1 changed files with 13 additions and 12 deletions
|
@ -416,25 +416,26 @@ trait PrivateMatchMethods: TNode
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Trigger transitions if necessary. This will reset `this_style` back to its old value if
|
|
||||||
// it did trigger a transition.
|
|
||||||
if animate_properties {
|
if animate_properties {
|
||||||
|
let this_opaque = self.opaque();
|
||||||
|
// Trigger any present animations if necessary.
|
||||||
|
let mut animations_started = animation::maybe_start_animations::<<Self::ConcreteElement as Element>::Impl>(
|
||||||
|
&context,
|
||||||
|
this_opaque,
|
||||||
|
&this_style);
|
||||||
|
|
||||||
|
// Trigger transitions if necessary. This will reset `this_style` back
|
||||||
|
// to its old value if it did trigger a transition.
|
||||||
if let Some(ref style) = style {
|
if let Some(ref style) = style {
|
||||||
let mut animations_started =
|
animations_started |=
|
||||||
animation::start_transitions_if_applicable::<Self::ConcreteComputedValues>(
|
animation::start_transitions_if_applicable::<Self::ConcreteComputedValues>(
|
||||||
&context.new_animations_sender,
|
&context.new_animations_sender,
|
||||||
self.opaque(),
|
this_opaque,
|
||||||
&**style,
|
&**style,
|
||||||
&mut this_style);
|
&mut this_style);
|
||||||
|
|
||||||
// TODO: Take into account animation-play-state
|
|
||||||
animations_started |= animation::maybe_start_animations::<<Self::ConcreteElement as Element>::Impl>(
|
|
||||||
&context,
|
|
||||||
self.opaque(),
|
|
||||||
&mut this_style);
|
|
||||||
|
|
||||||
cacheable = cacheable && !animations_started
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cacheable = cacheable && !animations_started
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate style difference.
|
// Calculate style difference.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue