Format remaining files

This commit is contained in:
Pyfisch 2018-11-06 13:01:35 +01:00
parent bf47f90da6
commit cb07debcb6
252 changed files with 5944 additions and 3744 deletions

View file

@ -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();
}