aboutsummaryrefslogtreecommitdiffstats
path: root/components/compositing
diff options
context:
space:
mode:
Diffstat (limited to 'components/compositing')
-rw-r--r--components/compositing/Cargo.toml4
-rw-r--r--components/compositing/constellation.rs18
-rw-r--r--components/compositing/lib.rs2
3 files changed, 21 insertions, 3 deletions
diff --git a/components/compositing/Cargo.toml b/components/compositing/Cargo.toml
index 37035dec23f..fcc129e2ccc 100644
--- a/components/compositing/Cargo.toml
+++ b/components/compositing/Cargo.toml
@@ -31,8 +31,8 @@ path = "../net_traits"
[dependencies.util]
path = "../util"
-[dependencies.webdriver_server]
-path = "../webdriver_server"
+[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 eb54339d159..2e7a975b731 100644
--- a/components/compositing/constellation.rs
+++ b/components/compositing/constellation.rs
@@ -39,6 +39,7 @@ use util::geometry::PagePx;
use util::opts;
use util::task::spawn_named;
use clipboard::ClipboardContext;
+use webdriver_traits::WebDriverScriptCommand;
/// Maintains the pipelines and navigation context and grants permission to composite.
pub struct Constellation<LTF, STF> {
@@ -410,6 +411,12 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
};
sender.send(result).unwrap();
}
+ ConstellationMsg::WebDriverCommandMsg(pipeline_id,
+ command) => {
+ debug!("constellation got webdriver command message");
+ self.handle_webdriver_command_msg(pipeline_id,
+ command);
+ }
}
true
}
@@ -753,6 +760,17 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
self.focus_parent_pipeline(pipeline_id);
}
+ fn handle_webdriver_command_msg(&mut self,
+ pipeline_id: PipelineId,
+ msg: WebDriverScriptCommand) {
+ // Find the script channel for the given parent pipeline,
+ // and pass the event to that script task.
+ let pipeline = self.pipeline(pipeline_id);
+ let control_msg = ConstellationControlMsg::WebDriverCommandMsg(pipeline_id, msg);
+ let ScriptControlChan(ref script_channel) = pipeline.script_chan;
+ script_channel.send(control_msg).unwrap();
+ }
+
fn add_or_replace_pipeline_in_frame_tree(&mut self, frame_change: FrameChange) {
// If the currently focused pipeline is the one being changed (or a child
diff --git a/components/compositing/lib.rs b/components/compositing/lib.rs
index f3f54cad388..7b8d49348c3 100644
--- a/components/compositing/lib.rs
+++ b/components/compositing/lib.rs
@@ -27,7 +27,7 @@ extern crate net_traits;
#[macro_use]
extern crate util;
extern crate gleam;
-extern crate webdriver_server;
+extern crate webdriver_traits;
extern crate clipboard;
extern crate libc;