diff options
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r-- | components/script/script_task.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs index 8573efa9d3f..fa397113c9b 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -602,6 +602,10 @@ impl ScriptTask { panic!("should have handled ExitPipeline already"), ConstellationControlMsg::GetTitle(pipeline_id) => self.handle_get_title_msg(pipeline_id), + ConstellationControlMsg::Freeze(pipeline_id) => + self.handle_freeze_msg(pipeline_id), + ConstellationControlMsg::Thaw(pipeline_id) => + self.handle_thaw_msg(pipeline_id) } } @@ -685,6 +689,26 @@ impl ScriptTask { window.r().handle_fire_timer(timer_id); } + /// Handles freeze message + fn handle_freeze_msg(&self, id: PipelineId) { + let page = self.page.borrow_mut(); + let page = page.find(id).expect("ScriptTask: received freeze msg for a + pipeline ID not associated with this script task. This is a bug."); + let frame = page.frame(); + let window = frame.as_ref().unwrap().window.root(); + window.r().freeze(); + } + + /// Handles thaw message + fn handle_thaw_msg(&self, id: PipelineId) { + let page = self.page.borrow_mut(); + let page = page.find(id).expect("ScriptTask: received thaw msg for a + pipeline ID not associated with this script task. This is a bug."); + let frame = page.frame(); + let window = frame.as_ref().unwrap().window.root(); + window.r().thaw(); + } + /// Handles a notification that reflow completed. fn handle_reflow_complete_msg(&self, pipeline_id: PipelineId, reflow_id: uint) { debug!("Script: Reflow {:?} complete for {:?}", reflow_id, pipeline_id); |