diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index edc19ce07a5..5f6a1f6527f 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -475,9 +475,9 @@ impl Constellation { debug!("constellation got get root pipeline message"); self.handle_get_pipeline(frame_id, resp_chan); } - ConstellationMsg::GetFrame(parent_pipeline_id, subpage_id, resp_chan) => { + ConstellationMsg::GetFrame(pipeline_id, resp_chan) => { debug!("constellation got get root pipeline message"); - self.handle_get_frame(parent_pipeline_id, subpage_id, resp_chan); + self.handle_get_frame(pipeline_id, resp_chan); } ConstellationMsg::Focus(pipeline_id) => { debug!("constellation got focus message"); @@ -919,11 +919,9 @@ impl Constellation { } fn handle_get_frame(&mut self, - containing_pipeline_id: PipelineId, - subpage_id: SubpageId, + pipeline_id: PipelineId, resp_chan: IpcSender>) { - 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); + let frame_id = self.pipeline_to_frame_map.get(&pipeline_id).map(|x| *x); resp_chan.send(frame_id).unwrap(); } diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index a594a4078e9..98fdcc052fb 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -260,8 +260,8 @@ pub enum Msg { /// id, or for the root frame if this is None, over a provided channel GetPipeline(Option, IpcSender>), /// Request that the constellation send the FrameId corresponding to the document - /// with the provided parent pipeline id and subpage id - GetFrame(PipelineId, SubpageId, IpcSender>), + /// with the provided pipeline id + GetFrame(PipelineId, IpcSender>), /// Notifies the constellation that this frame has received focus. Focus(PipelineId), /// Requests that the constellation retrieve the current contents of the clipboard diff --git a/components/msg/webdriver_msg.rs b/components/msg/webdriver_msg.rs index db0fccac228..63ac4aa7ffd 100644 --- a/components/msg/webdriver_msg.rs +++ b/components/msg/webdriver_msg.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use constellation_msg::{PipelineId, SubpageId}; +use constellation_msg::PipelineId; use ipc_channel::ipc::IpcSender; use rustc_serialize::json::{Json, ToJson}; use url::Url; @@ -16,7 +16,7 @@ pub enum WebDriverScriptCommand { GetActiveElement(IpcSender>), GetElementTagName(String, IpcSender>), GetElementText(String, IpcSender>), - GetFrameId(WebDriverFrameId, IpcSender, ()>>), + GetFrameId(WebDriverFrameId, IpcSender, ()>>), GetUrl(IpcSender), GetTitle(IpcSender) } diff --git a/components/script/webdriver_handlers.rs b/components/script/webdriver_handlers.rs index 15b31ff63e7..c48240d5d9d 100644 --- a/components/script/webdriver_handlers.rs +++ b/components/script/webdriver_handlers.rs @@ -17,7 +17,7 @@ use ipc_channel::ipc::IpcSender; use js::jsapi::JSContext; use js::jsapi::{HandleValue, RootedValue}; use js::jsval::UndefinedValue; -use msg::constellation_msg::{PipelineId, SubpageId}; +use msg::constellation_msg::PipelineId; use msg::webdriver_msg::{WebDriverFrameId, WebDriverJSError, WebDriverJSResult, WebDriverJSValue}; use page::Page; use script_task::get_page; @@ -85,7 +85,7 @@ pub fn handle_execute_async_script(page: &Rc, pub fn handle_get_frame_id(page: &Rc, pipeline: PipelineId, webdriver_frame_id: WebDriverFrameId, - reply: IpcSender, ()>>) { + reply: IpcSender, ()>>) { let window = match webdriver_frame_id { WebDriverFrameId::Short(_) => { // This isn't supported yet @@ -108,7 +108,7 @@ pub fn handle_get_frame_id(page: &Rc, } }; - let frame_id = window.map(|x| x.and_then(|x| x.r().parent_info())); + let frame_id = window.map(|x| x.map(|x| x.r().pipeline())); reply.send(frame_id).unwrap() } diff --git a/components/webdriver_server/lib.rs b/components/webdriver_server/lib.rs index 329ba90422c..bb3019582d0 100644 --- a/components/webdriver_server/lib.rs +++ b/components/webdriver_server/lib.rs @@ -451,10 +451,10 @@ impl Handler { } let frame = match receiver.recv().unwrap() { - Ok(Some((pipeline_id, subpage_id))) => { + Ok(Some(pipeline_id)) => { let (sender, receiver) = ipc::channel().unwrap(); let ConstellationChan(ref const_chan) = self.constellation_chan; - const_chan.send(ConstellationMsg::GetFrame(pipeline_id, subpage_id, sender)).unwrap(); + const_chan.send(ConstellationMsg::GetFrame(pipeline_id, sender)).unwrap(); receiver.recv().unwrap() }, Ok(None) => None,