servo: Merge #8151 - Implement support for WebDriver send keys command (from jgraham:webdriver_sendkeys); r=jgraham

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.

Source-Repo: https://github.com/servo/servo
Source-Revision: afe03870ce1a5a65b4c22f2e64155259da8b4609
This commit is contained in:
James Graham
2015-11-17 10:32:50 +05:00
parent 2a2d217a39
commit 8bd4d04d48
7 changed files with 252 additions and 2 deletions

View File

@@ -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>>),
}

View File

@@ -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, ()>>),