aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/xr.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2019-07-19 16:23:03 -0700
committerManish Goregaokar <manishsmail@gmail.com>2019-07-22 09:32:01 -0700
commitb66cbd364a2352a15f772355cc0d978c8ddda908 (patch)
tree10232341872d1742adcd8d0df5c8c873538282f9 /components/script/dom/xr.rs
parent638cc92e89e05806f69e620bf2f89772715bb1f7 (diff)
downloadservo-b66cbd364a2352a15f772355cc0d978c8ddda908.tar.gz
servo-b66cbd364a2352a15f772355cc0d978c8ddda908.zip
Support end events and end()
Diffstat (limited to 'components/script/dom/xr.rs')
-rw-r--r--components/script/dom/xr.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/components/script/dom/xr.rs b/components/script/dom/xr.rs
index 1ddf93c7a23..d24e8f144cd 100644
--- a/components/script/dom/xr.rs
+++ b/components/script/dom/xr.rs
@@ -76,6 +76,17 @@ impl XR {
self.pending_immersive_session.set(false);
self.active_immersive_session.set(Some(session))
}
+
+ /// https://immersive-web.github.io/webxr/#ref-for-eventdef-xrsession-end
+ pub fn end_session(&self, session: &XRSession) {
+ // Step 3
+ if let Some(active) = self.active_immersive_session.get() {
+ if Dom::from_ref(&*active) == Dom::from_ref(session) {
+ self.active_immersive_session.set(None);
+ }
+ }
+ // XXXManishearth when we support inline sessions we should remove them too
+ }
}
impl Drop for XR {