diff options
author | Connor Brewster <connor.brewster@eagles.oc.edu> | 2018-04-20 22:44:59 -0500 |
---|---|---|
committer | Connor Brewster <connor.brewster@eagles.oc.edu> | 2018-04-24 15:13:11 -0500 |
commit | e7ef9cfb303598e582f0f589da855bdd33c1dd08 (patch) | |
tree | 1c646a8c69c32f9045b81b0b7ab46270a7acbab3 /components/script/script_thread.rs | |
parent | 05fe8fa08d507836ce5659ff56f83022a90b241a (diff) | |
download | servo-e7ef9cfb303598e582f0f589da855bdd33c1dd08.tar.gz servo-e7ef9cfb303598e582f0f589da855bdd33c1dd08.zip |
Make session history aware of URLs
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 4e89ba4ceff..6ee0ec46d33 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -1169,7 +1169,7 @@ impl ScriptThread { Navigate(id, ..) => Some(id), PostMessage(id, ..) => Some(id), UpdatePipelineId(_, _, id, _) => Some(id), - UpdateHistoryStateId(id, ..) => Some(id), + UpdateHistoryState(id, ..) => Some(id), RemoveHistoryStates(id, ..) => Some(id), FocusIFrame(id, ..) => Some(id), WebDriverScriptCommand(id, ..) => Some(id), @@ -1297,8 +1297,8 @@ impl ScriptThread { browsing_context_id, new_pipeline_id, reason), - ConstellationControlMsg::UpdateHistoryStateId(pipeline_id, history_state_id) => - self.handle_update_history_state_id_msg(pipeline_id, history_state_id), + ConstellationControlMsg::UpdateHistoryState(pipeline_id, history_state_id, url) => + self.handle_update_history_state_msg(pipeline_id, history_state_id, url), ConstellationControlMsg::RemoveHistoryStates(pipeline_id, history_states) => self.handle_remove_history_states(pipeline_id, history_states), ConstellationControlMsg::FocusIFrame(parent_pipeline_id, frame_id) => @@ -1679,10 +1679,14 @@ impl ScriptThread { } } - fn handle_update_history_state_id_msg(&self, pipeline_id: PipelineId, history_state_id: Option<HistoryStateId>) { + fn handle_update_history_state_msg( + &self, pipeline_id: PipelineId, + history_state_id: Option<HistoryStateId>, + url: ServoUrl, + ) { match { self.documents.borrow().find_window(pipeline_id) } { None => return warn!("update history state after pipeline {} closed.", pipeline_id), - Some(window) => window.History().r().activate_state(history_state_id), + Some(window) => window.History().r().activate_state(history_state_id, url), } } |