mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Support end events and end()
This commit is contained in:
parent
638cc92e89
commit
b66cbd364a
7 changed files with 62 additions and 14 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue