aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_traits
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-08-10 10:28:07 -0400
committerGitHub <noreply@github.com>2019-08-10 10:28:07 -0400
commit79b456d84e94cb40cca3f043f34b29baf5c91e30 (patch)
treeb9a13663178746f2f823b5253ff71f6ea95417e2 /components/script_traits
parentb3c0ed295f743bff1a78d0a89c9bf3327f28fb50 (diff)
parent58f80f4ff3dda0504577a525d60a1af6becdef07 (diff)
downloadservo-79b456d84e94cb40cca3f043f34b29baf5c91e30.tar.gz
servo-79b456d84e94cb40cca3f043f34b29baf5c91e30.zip
Auto merge of #23725 - georgeroman:support_returning_arrays_from_execute_script, r=jdm
Support for returning array-like types from the Execute(Async)Script wd command <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors <!-- Either: --> - [X] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23725) <!-- Reviewable:end -->
Diffstat (limited to 'components/script_traits')
-rw-r--r--components/script_traits/Cargo.toml1
-rw-r--r--components/script_traits/webdriver_msg.rs6
2 files changed, 6 insertions, 1 deletions
diff --git a/components/script_traits/Cargo.toml b/components/script_traits/Cargo.toml
index 61e1dda7410..bd1011daad2 100644
--- a/components/script_traits/Cargo.toml
+++ b/components/script_traits/Cargo.toml
@@ -38,6 +38,7 @@ servo_url = {path = "../url"}
style_traits = {path = "../style_traits", features = ["servo"]}
time = "0.1.12"
url = "1.2"
+webdriver = "0.40"
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
webvr_traits = {path = "../webvr_traits"}
webxr-api = {git = "https://github.com/servo/webxr", features = ["ipc"]}
diff --git a/components/script_traits/webdriver_msg.rs b/components/script_traits/webdriver_msg.rs
index 7849a8580ef..c33a5ae302d 100644
--- a/components/script_traits/webdriver_msg.rs
+++ b/components/script_traits/webdriver_msg.rs
@@ -10,6 +10,7 @@ use hyper_serde::Serde;
use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::BrowsingContextId;
use servo_url::ServoUrl;
+use webdriver::common::WebElement;
#[derive(Debug, Deserialize, Serialize)]
pub enum WebDriverScriptCommand {
@@ -66,13 +67,16 @@ pub enum WebDriverJSValue {
Null,
Boolean(bool),
Number(f64),
- String(String), // TODO: Object and WebElement
+ String(String),
+ Element(WebElement),
+ ArrayLike(Vec<WebDriverJSValue>),
}
#[derive(Debug, Deserialize, Serialize)]
pub enum WebDriverJSError {
Timeout,
UnknownType,
+ JSError,
/// Occurs when handler received an event message for a layout channel that is not
/// associated with the current script thread
BrowsingContextNotFound,