aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/xr.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2020-01-15 13:16:33 +0530
committerManish Goregaokar <manishsmail@gmail.com>2020-01-21 15:47:30 -0800
commit535e05f7b2f8828f54b0a2f2196556b9227ed891 (patch)
tree2e4577e8ff2e2136b9c047a1e972321a6f9d7260 /components/script/dom/xr.rs
parentd33d21ce72e6396018712608251b3392c1786a68 (diff)
downloadservo-535e05f7b2f8828f54b0a2f2196556b9227ed891.tar.gz
servo-535e05f7b2f8828f54b0a2f2196556b9227ed891.zip
Correctly unset pending flag
Diffstat (limited to 'components/script/dom/xr.rs')
-rw-r--r--components/script/dom/xr.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/components/script/dom/xr.rs b/components/script/dom/xr.rs
index a2c4fd059f0..ab9c2c8264d 100644
--- a/components/script/dom/xr.rs
+++ b/components/script/dom/xr.rs
@@ -194,6 +194,9 @@ impl XRMethods for XR {
required_features.push(s)
} else {
warn!("Unable to convert required feature to string");
+ if mode != XRSessionMode::Inline {
+ self.pending_immersive_session.set(false);
+ }
promise.reject_error(Error::NotSupported);
return promise;
}
@@ -220,7 +223,6 @@ impl XRMethods for XR {
optional_features,
};
- let promise = Promise::new_in_current_compartment(&self.global(), comp);
let mut trusted = Some(TrustedPromise::new(promise.clone()));
let this = Trusted::new(self);
let (task_source, canceller) = window
@@ -253,7 +255,6 @@ impl XRMethods for XR {
window
.webxr_registry()
.request_session(mode.into(), init, sender, frame_sender);
-
promise
}
@@ -274,6 +275,9 @@ impl XR {
let session = match response {
Ok(session) => session,
Err(_) => {
+ if mode != XRSessionMode::Inline {
+ self.pending_immersive_session.set(false);
+ }
promise.reject_error(Error::NotSupported);
return;
},