mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Fix Document#elementsFromPoint no viewport available test
This commit is contained in:
parent
f39ec2b15e
commit
5a3ce597d3
2 changed files with 4 additions and 5 deletions
|
@ -1551,8 +1551,6 @@ impl Document {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn nodes_from_point(&self, page_point: &Point2D<f32>) -> Vec<UntrustedNodeAddress> {
|
pub fn nodes_from_point(&self, page_point: &Point2D<f32>) -> Vec<UntrustedNodeAddress> {
|
||||||
assert!(self.GetDocumentElement().is_some());
|
|
||||||
|
|
||||||
self.window.layout().nodes_from_point(*page_point)
|
self.window.layout().nodes_from_point(*page_point)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2718,6 +2716,10 @@ impl DocumentMethods for Document {
|
||||||
let window = window_from_node(self);
|
let window = window_from_node(self);
|
||||||
let viewport = window.window_size().unwrap().visible_viewport;
|
let viewport = window.window_size().unwrap().visible_viewport;
|
||||||
|
|
||||||
|
if self.browsing_context().is_none() {
|
||||||
|
return vec!();
|
||||||
|
}
|
||||||
|
|
||||||
// Step 2
|
// Step 2
|
||||||
if x < 0.0 || y < 0.0 || x > viewport.width.get() || y > viewport.height.get() {
|
if x < 0.0 || y < 0.0 || x > viewport.width.get() || y > viewport.height.get() {
|
||||||
return vec!();
|
return vec!();
|
||||||
|
|
|
@ -12,6 +12,3 @@
|
||||||
[no hit target at x,y]
|
[no hit target at x,y]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[No viewport available]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue