diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 977b573c040..e9e705fde85 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -131,10 +131,6 @@ pub struct LayoutTaskData { /// Receives newly-discovered animations. pub new_animations_receiver: Receiver, - /// A channel on which new animations that have been triggered by style recalculation can be - /// sent. - pub new_animations_sender: Sender, - /// A counter for epoch messages epoch: Epoch, @@ -222,6 +218,10 @@ pub struct LayoutTask { /// This can be used to easily check for invalid stale data. generation: u32, + /// A channel on which new animations that have been triggered by style recalculation can be + /// sent. + new_animations_sender: Sender, + /// A mutex to allow for fast, read-only RPC of layout's internal data /// structures, while still letting the LayoutTask modify them. /// @@ -433,6 +433,7 @@ impl LayoutTask { canvas_layers_sender: canvas_layers_sender, parallel_traversal: parallel_traversal, generation: 0, + new_animations_sender: new_animations_sender, rw_data: Arc::new(Mutex::new( LayoutTaskData { root_flow: None, @@ -448,7 +449,6 @@ impl LayoutTask { offset_parent_response: OffsetParentResponse::empty(), visible_rects: Arc::new(HashMap::with_hash_state(Default::default())), new_animations_receiver: new_animations_receiver, - new_animations_sender: new_animations_sender, epoch: Epoch(0), outstanding_web_fonts: outstanding_web_fonts_counter, })), @@ -486,7 +486,7 @@ impl LayoutTask { url: (*url).clone(), visible_rects: rw_data.visible_rects.clone(), generation: self.generation, - new_animations_sender: Mutex::new(rw_data.new_animations_sender.clone()), + new_animations_sender: Mutex::new(self.new_animations_sender.clone()), goal: goal, running_animations: rw_data.running_animations.clone(), }