aboutsummaryrefslogtreecommitdiffstats
path: root/components/msg
diff options
context:
space:
mode:
authorJames Graham <james@hoppipolla.co.uk>2015-06-16 17:32:42 +0100
committerJames Graham <james@hoppipolla.co.uk>2015-11-16 22:48:26 +0000
commit09b9293b092a89aaca651f3ce655e5a97878e52c (patch)
tree67cf816cd300717b8d5c8d3d364680db1ce230e9 /components/msg
parentdb94fda10e3351c96a0df61099d2fdfa481cc62b (diff)
downloadservo-09b9293b092a89aaca651f3ce655e5a97878e52c.tar.gz
servo-09b9293b092a89aaca651f3ce655e5a97878e52c.zip
Implement support for WebDriver send keys command.
Supports sending keys to an element. The specification here is still rather unfinished so the error handling and so on in this code will need iteration as it becomes clearer what the expected behaviour is.
Diffstat (limited to 'components/msg')
-rw-r--r--components/msg/constellation_msg.rs3
-rw-r--r--components/msg/webdriver_msg.rs1
2 files changed, 3 insertions, 1 deletions
diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs
index 009016e1433..7487fede8c2 100644
--- a/components/msg/constellation_msg.rs
+++ b/components/msg/constellation_msg.rs
@@ -61,7 +61,7 @@ pub struct WindowSizeData {
pub device_pixel_ratio: ScaleFactor<ViewportPx, DevicePixel, f32>,
}
-#[derive(PartialEq, Eq, Copy, Clone, Deserialize, Serialize)]
+#[derive(PartialEq, Eq, Copy, Clone, Debug, Deserialize, Serialize)]
pub enum KeyState {
Pressed,
Released,
@@ -360,6 +360,7 @@ pub enum WebDriverCommandMsg {
LoadUrl(PipelineId, LoadData, IpcSender<LoadStatus>),
Refresh(PipelineId, IpcSender<LoadStatus>),
ScriptCommand(PipelineId, WebDriverScriptCommand),
+ SendKeys(PipelineId, Vec<(Key, KeyModifiers, KeyState)>),
TakeScreenshot(PipelineId, IpcSender<Option<Image>>),
}
diff --git a/components/msg/webdriver_msg.rs b/components/msg/webdriver_msg.rs
index 63ac4aa7ffd..a0e6f83a57f 100644
--- a/components/msg/webdriver_msg.rs
+++ b/components/msg/webdriver_msg.rs
@@ -13,6 +13,7 @@ pub enum WebDriverScriptCommand {
ExecuteAsyncScript(String, IpcSender<WebDriverJSResult>),
FindElementCSS(String, IpcSender<Result<Option<String>, ()>>),
FindElementsCSS(String, IpcSender<Result<Vec<String>, ()>>),
+ FocusElement(String, IpcSender<Result<(), ()>>),
GetActiveElement(IpcSender<Option<String>>),
GetElementTagName(String, IpcSender<Result<String, ()>>),
GetElementText(String, IpcSender<Result<String, ()>>),