diff options
Diffstat (limited to 'components/compositing')
-rw-r--r-- | components/compositing/Cargo.toml | 3 | ||||
-rw-r--r-- | components/compositing/constellation.rs | 30 | ||||
-rw-r--r-- | components/compositing/lib.rs | 1 |
3 files changed, 22 insertions, 12 deletions
diff --git a/components/compositing/Cargo.toml b/components/compositing/Cargo.toml index 54be36997f9..944686bf559 100644 --- a/components/compositing/Cargo.toml +++ b/components/compositing/Cargo.toml @@ -37,9 +37,6 @@ path = "../style" [dependencies.util] path = "../util" -[dependencies.webdriver_traits] -path = "../webdriver_traits" - [dependencies.devtools_traits] path = "../devtools_traits" diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index 6b79722b7e4..8c4b2557cd8 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -29,7 +29,8 @@ use msg::constellation_msg::{IFrameSandboxState, MozBrowserEvent, NavigationDire use msg::constellation_msg::{Key, KeyState, KeyModifiers, LoadData}; use msg::constellation_msg::{SubpageId, WindowSizeData}; use msg::constellation_msg::{self, ConstellationChan, Failure}; -use msg::constellation_msg::{WebDriverCommandMsg}; +use msg::constellation_msg::WebDriverCommandMsg; +use msg::webdriver_msg; use net_traits::{self, ResourceTask}; use net_traits::image_cache_task::ImageCacheTask; use net_traits::storage_task::{StorageTask, StorageTaskMsg}; @@ -50,7 +51,6 @@ use util::geometry::PagePx; use util::opts; use util::task::spawn_named; use clipboard::ClipboardContext; -use webdriver_traits; /// Maintains the pipelines and navigation context and grants permission to composite. /// @@ -190,7 +190,7 @@ pub struct SendableFrameTree { } struct WebDriverData { - load_channel: Option<Sender<webdriver_traits::LoadComplete>> + load_channel: Option<Sender<webdriver_msg::LoadComplete>> } impl WebDriverData { @@ -425,9 +425,13 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> { subpage_id, event); } - ConstellationMsg::GetRootPipeline(resp_chan) => { + ConstellationMsg::GetPipeline(frame_id, resp_chan) => { debug!("constellation got get root pipeline message"); - self.handle_get_root_pipeline(resp_chan); + self.handle_get_pipeline(frame_id, resp_chan); + } + ConstellationMsg::GetFrame(parent_pipeline_id, subpage_id, resp_chan) => { + debug!("constellation got get root pipeline message"); + self.handle_get_frame(parent_pipeline_id, subpage_id, resp_chan); } ConstellationMsg::Focus(pipeline_id) => { debug!("constellation got focus message"); @@ -691,7 +695,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> { let back = !self.mut_frame(frame_id).prev.is_empty(); self.compositor_proxy.send(CompositorMsg::LoadComplete(back, forward)); if let Some(ref reply_chan) = self.webdriver.load_channel { - reply_chan.send(webdriver_traits::LoadComplete).unwrap(); + reply_chan.send(webdriver_msg::LoadComplete).unwrap(); } self.webdriver.load_channel = None; } @@ -815,14 +819,24 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> { pipeline.trigger_mozbrowser_event(subpage_id, event); } - fn handle_get_root_pipeline(&mut self, resp_chan: Sender<Option<PipelineId>>) { - let pipeline_id = self.root_frame_id.map(|frame_id| { + fn handle_get_pipeline(&mut self, frame_id: Option<FrameId>, + resp_chan: Sender<Option<PipelineId>>) { + let pipeline_id = frame_id.or(self.root_frame_id).map(|frame_id| { let frame = self.frames.get(&frame_id).unwrap(); frame.current }); resp_chan.send(pipeline_id).unwrap(); } + fn handle_get_frame(&mut self, + containing_pipeline_id: PipelineId, + subpage_id: SubpageId, + resp_chan: Sender<Option<FrameId>>) { + let frame_id = self.subpage_map.get(&(containing_pipeline_id, subpage_id)).and_then( + |x| self.pipeline_to_frame_map.get(&x)).map(|x| *x); + resp_chan.send(frame_id).unwrap(); + } + fn focus_parent_pipeline(&self, pipeline_id: PipelineId) { // Send a message to the parent of the provided pipeline (if it exists) // telling it to mark the iframe element as focused. diff --git a/components/compositing/lib.rs b/components/compositing/lib.rs index fcf3a84d44a..785a594aed9 100644 --- a/components/compositing/lib.rs +++ b/components/compositing/lib.rs @@ -28,7 +28,6 @@ extern crate style; #[macro_use] extern crate util; extern crate gleam; -extern crate webdriver_traits; extern crate clipboard; extern crate libc; |