diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 18f6618a58c..f039d7bee27 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -882,15 +882,13 @@ impl IOCompositor { fn on_load_url_window_event(&mut self, url_string: String) { debug!("osmain: loading URL `{}`", url_string); self.got_load_complete_message = false; - let root_pipeline_id = match self.scene.root { - Some(ref layer) => layer.get_pipeline_id(), - None => panic!("Compositor: Received WindowEvent::LoadUrl without initialized compositor \ - layers"), - }; let url = Url::parse(&url_string).unwrap(); self.window.set_page_url(url.clone()); + let msg = match self.scene.root { + Some(ref layer) => ConstellationMsg::LoadUrl(layer.get_pipeline_id(), LoadData::new(url)), + None => ConstellationMsg::InitLoadUrl(url) + }; - let msg = ConstellationMsg::LoadUrl(root_pipeline_id, LoadData::new(url)); let ConstellationChan(ref chan) = self.constellation_chan; chan.send(msg).unwrap() }