From 2456ddf4bad67dbaee298b3ee84169918d46c397 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 22 Oct 2015 15:59:52 +0200 Subject: [PATCH] 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/dom/window.rs | 7 ------- components/script/script_task.rs | 19 ++----------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 75a66716043..c292d0c4e20 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -1046,13 +1046,6 @@ impl Window { (element, response.rect) } - pub fn handle_reflow_complete_msg(&self, reflow_id: u32) { - let last_reflow_id = self.last_reflow_id.get(); - if last_reflow_id == reflow_id { - *self.layout_join_port.borrow_mut() = None; - } - } - pub fn init_browsing_context(&self, doc: &Document, frame_element: Option<&Element>) { let mut browsing_context = self.browsing_context.borrow_mut(); *browsing_context = Some(BrowsingContext::new(doc, frame_element)); 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();