aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/animation.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2020-05-05 13:36:57 +0200
committerMartin Robinson <mrobinson@igalia.com>2020-05-05 20:08:44 +0200
commit3a74013abcec241d67d2685e52a031409dc59dd4 (patch)
tree0fc6791d087797120dd960aa0fb1e0a9a6ebce92 /components/layout/animation.rs
parentb585ce5b1f181996b2f8109a4e045eb6f5b3e2a0 (diff)
downloadservo-3a74013abcec241d67d2685e52a031409dc59dd4.tar.gz
servo-3a74013abcec241d67d2685e52a031409dc59dd4.zip
Start having animations conform to the HTML spec
This is a small step toward fixing #19242. The main idea is that the clock for animations should advance as the event loop ticks. We accomplish this by moving the clock from layout and naming it the "animation timeline" which is the spec language. This should fix flakiness with animations and transitions tests where a reflow could move animations forward while script was running. This change also starts to break out transition and animation events into their own data structure, because it's quite likely that the next step in fixing #19242 is to no longer send these events through a channel.
Diffstat (limited to 'components/layout/animation.rs')
-rw-r--r--components/layout/animation.rs18
1 files changed, 10 insertions, 8 deletions
diff --git a/components/layout/animation.rs b/components/layout/animation.rs
index 09e3c75ec2c..c85d962008c 100644
--- a/components/layout/animation.rs
+++ b/components/layout/animation.rs
@@ -13,7 +13,7 @@ use msg::constellation_msg::PipelineId;
use script_traits::UntrustedNodeAddress;
use script_traits::{
AnimationState, ConstellationControlMsg, LayoutMsg as ConstellationMsg,
- TransitionOrAnimationEventType,
+ TransitionOrAnimationEvent, TransitionOrAnimationEventType,
};
use style::animation::{Animation, ElementAnimationState};
@@ -120,13 +120,15 @@ fn update_animation_state(
};
script_channel
- .send(ConstellationControlMsg::TransitionOrAnimationEvent {
- pipeline_id,
- event_type,
- node: node.to_untrusted_node_address(),
- property_or_animation_name,
- elapsed_time,
- })
+ .send(ConstellationControlMsg::TransitionOrAnimationEvent(
+ TransitionOrAnimationEvent {
+ pipeline_id,
+ event_type,
+ node: node.to_untrusted_node_address(),
+ property_or_animation_name,
+ elapsed_time,
+ },
+ ))
.unwrap()
};