diff options
author | Gilbert Röhrbein <gilbert@ifsr.de> | 2014-12-04 13:33:52 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2014-12-12 23:51:14 +0100 |
commit | 8da73afa06a89369a7506f44dc12c93b74392344 (patch) | |
tree | 1a2e720aa06256ac924de6bd5548c56c4d4883f5 /components/script | |
parent | 9b9f6627325e45588897fc9e5396901d42799e9e (diff) | |
download | servo-8da73afa06a89369a7506f44dc12c93b74392344.tar.gz servo-8da73afa06a89369a7506f44dc12c93b74392344.zip |
script_trask, handle_msgs: factored out handle_msg_from_constellation
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/script_task.rs | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs index bd30b6ab0f9..bd420f88048 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -537,16 +537,9 @@ impl ScriptTask { // Process the gathered events. for msg in sequential.into_iter() { match msg { - // TODO(tkuehn) need to handle auxiliary layouts for iframes - FromConstellation(AttachLayoutMsg(_)) => panic!("should have handled AttachLayoutMsg already"), - FromConstellation(LoadMsg(id, load_data)) => self.load(id, load_data), - FromConstellation(SendEventMsg(id, event)) => self.handle_event(id, event), - FromConstellation(ReflowCompleteMsg(id, reflow_id)) => self.handle_reflow_complete_msg(id, reflow_id), - FromConstellation(ResizeInactiveMsg(id, new_size)) => self.handle_resize_inactive_msg(id, new_size), - FromConstellation(ExitPipelineMsg(id)) => if self.handle_exit_pipeline_msg(id) { return false }, - FromConstellation(ViewportMsg(..)) => panic!("should have handled ViewportMsg already"), - FromConstellation(ResizeMsg(..)) => panic!("should have handled ResizeMsg already"), - FromConstellation(GetTitleMsg(pipeline_id)) => self.handle_get_title_msg(pipeline_id) + FromConstellation(ExitPipelineMsg(id)) => + if self.handle_exit_pipeline_msg(id) { return false }, + FromConstellation(inner_msg) => self.handle_msg_from_constellation(inner_msg), FromScript(TriggerLoadMsg(id, load_data)) => self.trigger_load(id, load_data), FromScript(TriggerFragmentMsg(id, url)) => self.trigger_fragment(id, url), FromScript(FireTimerMsg(FromWindow(id), timer_id)) => self.handle_fire_timer_msg(id, timer_id), @@ -575,6 +568,30 @@ impl ScriptTask { true } + fn handle_msg_from_constellation(&self, msg: ConstellationControlMsg) { + match msg { + // TODO(tkuehn) need to handle auxiliary layouts for iframes + AttachLayoutMsg(_) => + panic!("should have handled AttachLayoutMsg already"), + LoadMsg(id, load_data) => + self.load(id, load_data), + SendEventMsg(id, event) => + self.handle_event(id, event), + ReflowCompleteMsg(id, reflow_id) => + self.handle_reflow_complete_msg(id, reflow_id), + ResizeInactiveMsg(id, new_size) => + self.handle_resize_inactive_msg(id, new_size), + ViewportMsg(..) => + panic!("should have handled ViewportMsg already"), + ResizeMsg(..) => + panic!("should have handled ResizeMsg already"), + ExitPipelineMsg(..) => + panic!("should have handled ExitPipelineMsg already"), + GetTitleMsg(pipeline_id) => + self.handle_get_title_msg(pipeline_id), + } + } + fn handle_new_layout(&self, new_layout_info: NewLayoutInfo) { let NewLayoutInfo { old_pipeline_id, |