From 9d739cf684f0fcc59ae1e0e91ba804481e4d7aa2 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 22 Oct 2015 15:54:38 +0200 Subject: Remove layout_is_idle. Code on the script thread can only observe self.layout_join_port being Some() between the time it is set in force_reflow, and the join_layout call later in that function, and no significant code is called in that code. This implies that layout_is_idle will always return true, so there is no reason for the function to exist. --- components/script/script_task.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'components/script/script_task.rs') diff --git a/components/script/script_task.rs b/components/script/script_task.rs index a090d1c91ef..8426363a69e 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -712,12 +712,10 @@ impl ScriptTask { for page in page.iter() { // Only process a resize if layout is idle. let window = page.window(); - if window.r().layout_is_idle() { - let resize_event = window.r().steal_resize_event(); - match resize_event { - Some(size) => resizes.push((window.r().pipeline(), size)), - None => () - } + let resize_event = window.r().steal_resize_event(); + match resize_event { + Some(size) => resizes.push((window.r().pipeline(), size)), + None => () } } } -- cgit v1.2.3 From 2456ddf4bad67dbaee298b3ee84169918d46c397 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 22 Oct 2015 15:59:52 +0200 Subject: Remove Window::handle_reflow_complete_msg and ScriptTask::handle_reflow_complete_msg. Code on the script thread can only observe self.layout_join_port being Some() between the time it is set in force_reflow, and the join_layout call later in that function, and no significant code is called in that code. Since these functions do nothing useful if layout_join_port is None, there is no point in keeping them. --- components/script/script_task.rs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'components/script/script_task.rs') diff --git a/components/script/script_task.rs b/components/script/script_task.rs index 8426363a69e..98431ab1330 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -935,8 +935,8 @@ impl ScriptTask { self.handle_navigate(pipeline_id, Some(subpage_id), load_data), ConstellationControlMsg::SendEvent(id, event) => self.handle_event(id, event), - ConstellationControlMsg::ReflowComplete(id, reflow_id) => - self.handle_reflow_complete_msg(id, reflow_id), + ConstellationControlMsg::ReflowComplete(_id, _reflow_id) => + (), ConstellationControlMsg::ResizeInactive(id, new_size) => self.handle_resize_inactive_msg(id, new_size), ConstellationControlMsg::Viewport(..) => @@ -1383,21 +1383,6 @@ impl ScriptTask { frame_element.r().unwrap().update_subpage_id(new_subpage_id); } - /// Handles a notification that reflow completed. - fn handle_reflow_complete_msg(&self, pipeline_id: PipelineId, reflow_id: u32) { - debug!("Script: Reflow {:?} complete for {:?}", reflow_id, pipeline_id); - let page = self.root_page(); - match page.find(pipeline_id) { - Some(page) => { - let window = page.window(); - window.r().handle_reflow_complete_msg(reflow_id); - } - None => { - assert!(self.closed_pipelines.borrow().contains(&pipeline_id)); - } - } - } - /// Window was resized, but this script was not active, so don't reflow yet fn handle_resize_inactive_msg(&self, id: PipelineId, new_size: WindowSizeData) { let page = self.root_page(); -- cgit v1.2.3 From 9ad69586d17dae565e9b5a1ff2340eca6f161d43 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 22 Oct 2015 16:06:54 +0200 Subject: Remove the ConstellationControlMsg::ReflowComplete message. --- components/script/script_task.rs | 2 -- 1 file changed, 2 deletions(-) (limited to 'components/script/script_task.rs') diff --git a/components/script/script_task.rs b/components/script/script_task.rs index 98431ab1330..8216cbfbacf 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -935,8 +935,6 @@ impl ScriptTask { self.handle_navigate(pipeline_id, Some(subpage_id), load_data), ConstellationControlMsg::SendEvent(id, event) => self.handle_event(id, event), - ConstellationControlMsg::ReflowComplete(_id, _reflow_id) => - (), ConstellationControlMsg::ResizeInactive(id, new_size) => self.handle_resize_inactive_msg(id, new_size), ConstellationControlMsg::Viewport(..) => -- cgit v1.2.3