mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Add feature gating for hit tests
This commit is contained in:
parent
1b07b77323
commit
30cd89d2d8
1 changed files with 12 additions and 0 deletions
|
@ -741,6 +741,18 @@ impl XRSessionMethods for XRSession {
|
||||||
fn RequestHitTestSource(&self, options: &XRHitTestOptionsInit) -> Rc<Promise> {
|
fn RequestHitTestSource(&self, options: &XRHitTestOptionsInit) -> Rc<Promise> {
|
||||||
let p = Promise::new(&self.global());
|
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();
|
let id = self.next_hit_test_id.get();
|
||||||
self.next_hit_test_id.set(HitTestId(id.0 + 1));
|
self.next_hit_test_id.set(HitTestId(id.0 + 1));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue