diff options
author | Paul Rouget <me@paulrouget.com> | 2017-07-18 08:19:44 +0200 |
---|---|---|
committer | Paul Rouget <me@paulrouget.com> | 2017-08-15 08:22:09 +0200 |
commit | d2413891292bfb4d5f17d7eb1e3882e07f6ac626 (patch) | |
tree | 17d2768aaa861740b6bcf638d2a3219086828a74 /components/script/dom/history.rs | |
parent | 817de1573556b49038d8b704398bb32e78296a43 (diff) | |
download | servo-d2413891292bfb4d5f17d7eb1e3882e07f6ac626.tar.gz servo-d2413891292bfb4d5f17d7eb1e3882e07f6ac626.zip |
make use of ScriptToConstellationChan
Diffstat (limited to 'components/script/dom/history.rs')
-rw-r--r-- | components/script/dom/history.rs | 12 |
1 files changed, 5 insertions, 7 deletions
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::<GlobalScope>().constellation_chan().send(msg); + let msg = ScriptMsg::TraverseHistory(direction); + let _ = self.window.upcast::<GlobalScope>().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::<GlobalScope>().constellation_chan().send(msg); + let msg = ScriptMsg::JointSessionHistoryLength(sender); + let _ = self.window.upcast::<GlobalScope>().script_to_constellation_chan().send(msg); Ok(recv.recv().unwrap()) } |