Restyle should reflect animations and transitions

When doing a restyle, we should apply animations and transitions to the
new style so that it is reflected in `getComputedStyle()` and the new
style information properly cascades. This is the first part of properly
ticking animations and transitions.

This causes a couple new animations tests failures (along with many new
passes), but we currently don't have support for properly handling
animations after they have completed, so this isn't totally unexpected.
This commit is contained in:
Martin Robinson 2020-04-27 11:44:03 +02:00
parent cd620f69de
commit 5ca2e7ce91
62 changed files with 344 additions and 10360 deletions

View file

@ -15,6 +15,7 @@ use script_traits::UntrustedNodeAddress;
use script_traits::{
AnimationState, ConstellationControlMsg, LayoutMsg as ConstellationMsg, TransitionEventType,
};
use servo_arc::Arc;
use style::animation::{
update_style_for_animation, Animation, ElementAnimationState, PropertyAnimation,
};
@ -223,7 +224,7 @@ fn do_recalc_style_for_animations<E>(
update_style_for_animation::<E>(
&context.style_context,
animation,
&mut fragment.style,
Arc::make_mut(&mut fragment.style),
&ServoMetricsProvider,
);
let difference = RestyleDamage::compute_style_difference(&old_style, &fragment.style);