aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/webdriver_handlers.rs
diff options
context:
space:
mode:
authorPyfisch <pyfisch@gmail.com>2018-11-06 13:01:35 +0100
committerPyfisch <pyfisch@gmail.com>2018-11-06 22:30:31 +0100
commitcb07debcb6f3d3561177ce536c320986720791b7 (patch)
treeccac4d5a48b3112230f3fc2e873753dd7263e9fb /components/script/webdriver_handlers.rs
parentbf47f90da667e95eaffc8fee36ca8a88e72e276c (diff)
downloadservo-cb07debcb6f3d3561177ce536c320986720791b7.tar.gz
servo-cb07debcb6f3d3561177ce536c320986720791b7.zip
Format remaining files
Diffstat (limited to 'components/script/webdriver_handlers.rs')
-rw-r--r--components/script/webdriver_handlers.rs39
1 files changed, 26 insertions, 13 deletions
diff --git a/components/script/webdriver_handlers.rs b/components/script/webdriver_handlers.rs
index 3bc95be171f..30291e62be7 100644
--- a/components/script/webdriver_handlers.rs
+++ b/components/script/webdriver_handlers.rs
@@ -147,7 +147,8 @@ pub fn handle_get_browsing_context_id(
.and_then(|node| {
node.downcast::<HTMLIFrameElement>()
.and_then(|elem| elem.browsing_context_id())
- }).ok_or(()),
+ })
+ .ok_or(()),
WebDriverFrameId::Parent => documents
.find_window(pipeline)
.and_then(|window| {
@@ -155,7 +156,8 @@ pub fn handle_get_browsing_context_id(
.window_proxy()
.parent()
.map(|parent| parent.browsing_context_id())
- }).ok_or(()),
+ })
+ .ok_or(()),
};
reply.send(result).unwrap()
@@ -187,7 +189,8 @@ pub fn handle_find_elements_css(
.and_then(|doc| {
doc.QuerySelectorAll(DOMString::from(selector))
.map_err(|_| ())
- }).map(|nodes| {
+ })
+ .map(|nodes| {
nodes
.iter()
.map(|x| x.upcast::<Node>().unique_id())
@@ -217,7 +220,8 @@ pub fn handle_focus_element(
},
None => Err(()),
},
- ).unwrap();
+ )
+ .unwrap();
}
pub fn handle_get_active_element(
@@ -231,7 +235,8 @@ pub fn handle_get_active_element(
.find_document(pipeline)
.and_then(|doc| doc.GetActiveElement())
.map(|elem| elem.upcast::<Node>().unique_id()),
- ).unwrap();
+ )
+ .unwrap();
}
pub fn handle_get_cookies(
@@ -326,7 +331,8 @@ pub fn handle_add_cookie(
Ok(())
},
(_, _) => Err(WebDriverCookieError::UnableToSetCookie),
- }).unwrap();
+ })
+ .unwrap();
}
pub fn handle_get_title(documents: &Documents, pipeline: PipelineId, reply: IpcSender<String>) {
@@ -382,7 +388,8 @@ pub fn handle_get_rect(
},
None => Err(()),
},
- ).unwrap();
+ )
+ .unwrap();
}
pub fn handle_get_text(
@@ -395,7 +402,8 @@ pub fn handle_get_text(
.send(match find_node_by_unique_id(documents, pipeline, node_id) {
Some(ref node) => Ok(node.GetTextContent().map_or("".to_owned(), String::from)),
None => Err(()),
- }).unwrap();
+ })
+ .unwrap();
}
pub fn handle_get_name(
@@ -408,7 +416,8 @@ pub fn handle_get_name(
.send(match find_node_by_unique_id(documents, pipeline, node_id) {
Some(node) => Ok(String::from(node.downcast::<Element>().unwrap().TagName())),
None => Err(()),
- }).unwrap();
+ })
+ .unwrap();
}
pub fn handle_get_attribute(
@@ -426,7 +435,8 @@ pub fn handle_get_attribute(
.GetAttribute(DOMString::from(name))
.map(String::from)),
None => Err(()),
- }).unwrap();
+ })
+ .unwrap();
}
pub fn handle_get_css(
@@ -448,7 +458,8 @@ pub fn handle_get_css(
))
},
None => Err(()),
- }).unwrap();
+ })
+ .unwrap();
}
pub fn handle_get_url(documents: &Documents, pipeline: PipelineId, reply: IpcSender<ServoUrl>) {
@@ -475,7 +486,8 @@ pub fn handle_is_enabled(
},
None => Err(()),
},
- ).unwrap();
+ )
+ .unwrap();
}
pub fn handle_is_selected(
@@ -500,5 +512,6 @@ pub fn handle_is_selected(
},
None => Err(()),
},
- ).unwrap();
+ )
+ .unwrap();
}