Skip to content

Commit

Permalink
Add feature gating for hit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Apr 20, 2020
1 parent 1b07b77 commit 30cd89d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions components/script/dom/xrsession.rs
Expand Up @@ -741,6 +741,18 @@ impl XRSessionMethods for XRSession {
fn RequestHitTestSource(&self, options: &XRHitTestOptionsInit) -> Rc<Promise> {
let p = Promise::new(&self.global());

if self
.session
.borrow()
.granted_features()
.iter()
.find(|f| &**f == "hit-test")
.is_none()
{
p.reject_error(Error::NotSupported);
return p;
}

let id = self.next_hit_test_id.get();
self.next_hit_test_id.set(HitTestId(id.0 + 1));

Expand Down

0 comments on commit 30cd89d

Please sign in to comment.