servo: Merge #8548 - Remove the unused arguments to hit_test and mouse_over (from Ms2ger:unused-tna); r=pcwalton
I don't think this code is called when there is no document element, but I added assertions to make sure we notice in case I was wrong. Source-Repo: https://github.com/servo/servo Source-Revision: 20d26853e145e275695463662b6cee334cd27085
This commit is contained in:
@@ -483,30 +483,19 @@ impl Document {
|
||||
}
|
||||
|
||||
pub fn hit_test(&self, point: &Point2D<f32>) -> Option<UntrustedNodeAddress> {
|
||||
let root = self.GetDocumentElement();
|
||||
let root = match root.r() {
|
||||
Some(root) => root,
|
||||
None => return None,
|
||||
};
|
||||
let root = root.upcast::<Node>();
|
||||
let address = match self.window.layout().hit_test(root.to_trusted_node_address(), *point) {
|
||||
assert!(self.GetDocumentElement().is_some());
|
||||
match self.window.layout().hit_test(*point) {
|
||||
Ok(HitTestResponse(node_address)) => Some(node_address),
|
||||
Err(()) => {
|
||||
debug!("layout query error");
|
||||
None
|
||||
}
|
||||
};
|
||||
address
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_nodes_under_mouse(&self, point: &Point2D<f32>) -> Vec<UntrustedNodeAddress> {
|
||||
let root = self.GetDocumentElement();
|
||||
let root = match root.r() {
|
||||
Some(root) => root,
|
||||
None => return vec!(),
|
||||
};
|
||||
let root = root.upcast::<Node>();
|
||||
match self.window.layout().mouse_over(root.to_trusted_node_address(), *point) {
|
||||
assert!(self.GetDocumentElement().is_some());
|
||||
match self.window.layout().mouse_over(*point) {
|
||||
Ok(MouseOverResponse(node_address)) => node_address,
|
||||
Err(()) => vec!(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user