diff --git a/servo/components/layout/query.rs b/servo/components/layout/query.rs index d8742973460c..3f45941e93a9 100644 --- a/servo/components/layout/query.rs +++ b/servo/components/layout/query.rs @@ -148,7 +148,9 @@ impl LayoutRPC for LayoutRPCImpl { let result = match rw_data.display_list { None => panic!("Tried to hit test without a DisplayList"), Some(ref display_list) => { - display_list.hit_test(&page_point, &client_point, &rw_data.stacking_context_scroll_offsets) + display_list.hit_test(&page_point, + &client_point, + &rw_data.stacking_context_scroll_offsets) } }; diff --git a/servo/components/script/dom/document.rs b/servo/components/script/dom/document.rs index 5f1bf4c45cde..646b307a3e61 100644 --- a/servo/components/script/dom/document.rs +++ b/servo/components/script/dom/document.rs @@ -1583,12 +1583,12 @@ impl Document { self.browsing_context.is_none() || !url_has_network_scheme(&self.url) } - pub fn nodes_from_point(&self, page_point: &Point2D) -> Vec { - let client_point = - Point2D::new(page_point.x - self.window.PageXOffset() as f32, - page_point.y - self.window.PageYOffset() as f32); + pub fn nodes_from_point(&self, client_point: &Point2D) -> Vec { + let page_point = + Point2D::new(client_point.x + self.window.PageXOffset() as f32, + client_point.y + self.window.PageYOffset() as f32); - self.window.layout().nodes_from_point(*page_point, client_point) + self.window.layout().nodes_from_point(page_point, *client_point) } }