Skip to content

Commit

Permalink
Fix Document#elementFromPoint no viewport available test
Browse files Browse the repository at this point in the history
  • Loading branch information
luthfianto committed Apr 16, 2016
1 parent 86778a0 commit 5ad312c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions components/script/dom/document.rs
Expand Up @@ -2687,6 +2687,10 @@ impl DocumentMethods for Document {
let window = window_from_node(self);
let viewport = window.window_size().unwrap().visible_viewport;

if self.browsing_context().is_none() {
return None;
}

if x < 0.0 || y < 0.0 || x > viewport.width.get() || y > viewport.height.get() {
return None;
}
Expand Down
3 changes: 0 additions & 3 deletions tests/wpt/metadata/cssom-view/elementFromPoint.html.ini
Expand Up @@ -12,9 +12,6 @@
[no hit target at x,y]
expected: FAIL

[No viewport available]
expected: FAIL

[Image Maps]
expected: FAIL

0 comments on commit 5ad312c

Please sign in to comment.