From d2413891292bfb4d5f17d7eb1e3882e07f6ac626 Mon Sep 17 00:00:00 2001 From: Paul Rouget Date: Tue, 18 Jul 2017 08:19:44 +0200 Subject: make use of ScriptToConstellationChan --- components/script/dom/history.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'components/script/dom/history.rs') diff --git a/components/script/dom/history.rs b/components/script/dom/history.rs index b9601d2ca1c..9344f3f4b80 100644 --- a/components/script/dom/history.rs +++ b/components/script/dom/history.rs @@ -15,7 +15,7 @@ use dom::window::Window; use dom_struct::dom_struct; use ipc_channel::ipc; use msg::constellation_msg::TraversalDirection; -use script_traits::ScriptMsg as ConstellationMsg; +use script_traits::ScriptMsg; // https://html.spec.whatwg.org/multipage/#the-history-interface #[dom_struct] @@ -44,9 +44,8 @@ impl History { if !self.window.Document().is_fully_active() { return Err(Error::Security); } - let top_level_browsing_context_id = self.window.window_proxy().top_level_browsing_context_id(); - let msg = ConstellationMsg::TraverseHistory(top_level_browsing_context_id, direction); - let _ = self.window.upcast::().constellation_chan().send(msg); + let msg = ScriptMsg::TraverseHistory(direction); + let _ = self.window.upcast::().script_to_constellation_chan().send(msg); Ok(()) } } @@ -57,10 +56,9 @@ impl HistoryMethods for History { if !self.window.Document().is_fully_active() { return Err(Error::Security); } - let top_level_browsing_context_id = self.window.window_proxy().top_level_browsing_context_id(); let (sender, recv) = ipc::channel().expect("Failed to create channel to send jsh length."); - let msg = ConstellationMsg::JointSessionHistoryLength(top_level_browsing_context_id, sender); - let _ = self.window.upcast::().constellation_chan().send(msg); + let msg = ScriptMsg::JointSessionHistoryLength(sender); + let _ = self.window.upcast::().script_to_constellation_chan().send(msg); Ok(recv.recv().unwrap()) } -- cgit v1.2.3