diff --git a/servo/components/script/script_task.rs b/servo/components/script/script_task.rs index e34e93008d2d..9254d67b0f2e 100644 --- a/servo/components/script/script_task.rs +++ b/servo/components/script/script_task.rs @@ -665,8 +665,9 @@ impl ScriptTask { } }; - // Squash any pending resize, reflow, and mouse-move events in the queue. + // Squash any pending resize, reflow, animation tick, and mouse-move events in the queue. let mut mouse_move_event_index = None; + let mut animation_ticks = HashSet::new(); loop { match event { // This has to be handled before the ResizeMsg below, @@ -682,6 +683,13 @@ impl ScriptTask { MixedMessage::FromConstellation(ConstellationControlMsg::Viewport(id, rect)) => { self.handle_viewport(id, rect); } + MixedMessage::FromConstellation(ConstellationControlMsg::TickAllAnimations( + pipeline_id)) => { + if !animation_ticks.contains(&pipeline_id) { + animation_ticks.insert(pipeline_id); + sequential.push(event); + } + } MixedMessage::FromConstellation(ConstellationControlMsg::SendEvent( _, MouseMoveEvent(_))) => {