mirror of
https://github.com/servo/servo.git
synced 2025-07-03 05:23:38 +01:00
Add stubs for session start/end
This commit is contained in:
parent
df1f865cb2
commit
ffc943fec7
4 changed files with 18 additions and 2 deletions
|
@ -33,7 +33,7 @@ interface XRSession : EventTarget {
|
||||||
long requestAnimationFrame(XRFrameRequestCallback callback);
|
long requestAnimationFrame(XRFrameRequestCallback callback);
|
||||||
void cancelAnimationFrame(long handle);
|
void cancelAnimationFrame(long handle);
|
||||||
|
|
||||||
// Promise<void> end();
|
Promise<void> end();
|
||||||
|
|
||||||
// // Events
|
// // Events
|
||||||
// attribute EventHandler onblur;
|
// attribute EventHandler onblur;
|
||||||
|
|
|
@ -16,7 +16,7 @@ interface XRTest {
|
||||||
void simulateUserActivation(Function f);
|
void simulateUserActivation(Function f);
|
||||||
|
|
||||||
// // Disconnect all fake devices
|
// // Disconnect all fake devices
|
||||||
// Promise<void> disconnectAllDevices();
|
Promise<void> disconnectAllDevices();
|
||||||
};
|
};
|
||||||
|
|
||||||
dictionary FakeXRDeviceInit {
|
dictionary FakeXRDeviceInit {
|
||||||
|
|
|
@ -288,6 +288,14 @@ impl XRSessionMethods for XRSession {
|
||||||
.map(|x| DomRoot::from_ref(&**x))
|
.map(|x| DomRoot::from_ref(&**x))
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// https://immersive-web.github.io/webxr/#dom-xrsession-end
|
||||||
|
fn End(&self) -> Rc<Promise> {
|
||||||
|
// XXXManishearth implement device disconnection and session ending
|
||||||
|
let p = Promise::new(&self.global());
|
||||||
|
p.resolve_native(&());
|
||||||
|
p
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
|
|
|
@ -170,4 +170,12 @@ impl XRTestMethods for XRTest {
|
||||||
// XXXManishearth actually check for activation in XRSession
|
// XXXManishearth actually check for activation in XRSession
|
||||||
let _ = f.Call__(vec![], ExceptionHandling::Rethrow);
|
let _ = f.Call__(vec![], ExceptionHandling::Rethrow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// https://github.com/immersive-web/webxr-test-api/blob/master/explainer.md
|
||||||
|
fn DisconnectAllDevices(&self) -> Rc<Promise> {
|
||||||
|
// XXXManishearth implement device disconnection and session ending
|
||||||
|
let p = Promise::new(&self.global());
|
||||||
|
p.resolve_native(&());
|
||||||
|
p
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue