aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/webdriver_handlers.rs
diff options
context:
space:
mode:
authorAlan Jeffrey <ajeffrey@mozilla.com>2017-05-22 09:40:17 -0500
committerAlan Jeffrey <ajeffrey@mozilla.com>2017-05-25 17:14:28 -0500
commit79743b5358c989da23c11c025509dd2c46dba48b (patch)
treef8a05416245fb9d5b56fbc6ac73fe56b20fddb4f /components/script/webdriver_handlers.rs
parent3c267d7fddd036f6bcc9ebf000ed37665cf7496d (diff)
downloadservo-79743b5358c989da23c11c025509dd2c46dba48b.tar.gz
servo-79743b5358c989da23c11c025509dd2c46dba48b.zip
Webdriver uses browsing context ids rather than pipeline ids.
Diffstat (limited to 'components/script/webdriver_handlers.rs')
-rw-r--r--components/script/webdriver_handlers.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/components/script/webdriver_handlers.rs b/components/script/webdriver_handlers.rs
index 7bc31263c25..1aa2ad05dab 100644
--- a/components/script/webdriver_handlers.rs
+++ b/components/script/webdriver_handlers.rs
@@ -29,6 +29,7 @@ use hyper_serde::Serde;
use ipc_channel::ipc::{self, IpcSender};
use js::jsapi::{HandleValue, JSContext};
use js::jsval::UndefinedValue;
+use msg::constellation_msg::BrowsingContextId;
use msg::constellation_msg::PipelineId;
use net_traits::CookieSource::{HTTP, NonHTTP};
use net_traits::CoreResourceMsg::{GetCookiesDataForUrl, SetCookieForUrl};
@@ -109,23 +110,23 @@ pub fn handle_execute_async_script(documents: &Documents,
window.upcast::<GlobalScope>().evaluate_js_on_global_with_result(&eval, rval.handle_mut());
}
-pub fn handle_get_pipeline_id(documents: &Documents,
- pipeline: PipelineId,
- webdriver_frame_id: WebDriverFrameId,
- reply: IpcSender<Result<Option<PipelineId>, ()>>) {
+pub fn handle_get_browsing_context_id(documents: &Documents,
+ pipeline: PipelineId,
+ webdriver_frame_id: WebDriverFrameId,
+ reply: IpcSender<Result<BrowsingContextId, ()>>) {
let result = match webdriver_frame_id {
WebDriverFrameId::Short(_) => {
// This isn't supported yet
- Ok(None)
+ Err(())
},
WebDriverFrameId::Element(x) => {
find_node_by_unique_id(documents, pipeline, x)
- .and_then(|node| node.downcast::<HTMLIFrameElement>().map(|elem| elem.pipeline_id()))
+ .and_then(|node| node.downcast::<HTMLIFrameElement>().and_then(|elem| elem.browsing_context_id()))
.ok_or(())
},
WebDriverFrameId::Parent => {
documents.find_window(pipeline)
- .map(|window| window.parent_info().map(|(parent_id, _)| parent_id))
+ .and_then(|window| window.window_proxy().parent().map(|parent| parent.browsing_context_id()))
.ok_or(())
}
};