auto merge of #4330 : Ms2ger/servo/page, r=jdm

This commit is contained in:
bors-servo 2014-12-11 08:07:14 -07:00
commit d67bcfa7ce

View file

@ -434,11 +434,10 @@ impl Page {
pub fn hit_test(&self, point: &Point2D<f32>) -> Option<UntrustedNodeAddress> {
let frame = self.frame();
let document = frame.as_ref().unwrap().document.root();
let root = document.GetDocumentElement().root();
if root.is_none() {
return None;
}
let root = root.unwrap();
let root = match document.GetDocumentElement().root() {
None => return None,
Some(root) => root,
};
let root: JSRef<Node> = NodeCast::from_ref(*root);
let address = match self.layout().hit_test(root.to_trusted_node_address(), *point) {
Ok(HitTestResponse(node_address)) => {
@ -455,11 +454,10 @@ impl Page {
pub fn get_nodes_under_mouse(&self, point: &Point2D<f32>) -> Option<Vec<UntrustedNodeAddress>> {
let frame = self.frame();
let document = frame.as_ref().unwrap().document.root();
let root = document.GetDocumentElement().root();
if root.is_none() {
return None;
}
let root = root.unwrap();
let root = match document.GetDocumentElement().root() {
None => return None,
Some(root) => root,
};
let root: JSRef<Node> = NodeCast::from_ref(*root);
let address = match self.layout().mouse_over(root.to_trusted_node_address(), *point) {
Ok(MouseOverResponse(node_address)) => {