mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Add XR.test()
This commit is contained in:
parent
422faddedf
commit
c689866d35
3 changed files with 14 additions and 0 deletions
|
@ -28,3 +28,8 @@ dictionary XRSessionCreationOptions {
|
||||||
XRSessionMode mode = "inline";
|
XRSessionMode mode = "inline";
|
||||||
// XRPresentationContext outputContext;
|
// XRPresentationContext outputContext;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
partial interface XR {
|
||||||
|
// https://github.com/immersive-web/webxr-test-api/
|
||||||
|
[SameObject, Pref="dom.webxr.test"] readonly attribute XRTest test;
|
||||||
|
};
|
||||||
|
|
|
@ -21,6 +21,7 @@ use crate::dom::promise::Promise;
|
||||||
use crate::dom::vrdisplay::VRDisplay;
|
use crate::dom::vrdisplay::VRDisplay;
|
||||||
use crate::dom::vrdisplayevent::VRDisplayEvent;
|
use crate::dom::vrdisplayevent::VRDisplayEvent;
|
||||||
use crate::dom::xrsession::XRSession;
|
use crate::dom::xrsession::XRSession;
|
||||||
|
use crate::dom::xrtest::XRTest;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use ipc_channel::ipc::IpcSender;
|
use ipc_channel::ipc::IpcSender;
|
||||||
use profile_traits::ipc;
|
use profile_traits::ipc;
|
||||||
|
@ -36,6 +37,7 @@ pub struct XR {
|
||||||
gamepads: DomRefCell<Vec<Dom<Gamepad>>>,
|
gamepads: DomRefCell<Vec<Dom<Gamepad>>>,
|
||||||
pending_immersive_session: Cell<bool>,
|
pending_immersive_session: Cell<bool>,
|
||||||
active_immersive_session: MutNullableDom<VRDisplay>,
|
active_immersive_session: MutNullableDom<VRDisplay>,
|
||||||
|
test: MutNullableDom<XRTest>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl XR {
|
impl XR {
|
||||||
|
@ -46,6 +48,7 @@ impl XR {
|
||||||
gamepads: DomRefCell::new(Vec::new()),
|
gamepads: DomRefCell::new(Vec::new()),
|
||||||
pending_immersive_session: Cell::new(false),
|
pending_immersive_session: Cell::new(false),
|
||||||
active_immersive_session: Default::default(),
|
active_immersive_session: Default::default(),
|
||||||
|
test: Default::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,6 +144,11 @@ impl XRMethods for XR {
|
||||||
session.xr_present(promise.clone());
|
session.xr_present(promise.clone());
|
||||||
promise
|
promise
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://github.com/immersive-web/webxr-test-api/blob/master/explainer.md
|
||||||
|
fn Test(&self) -> DomRoot<XRTest> {
|
||||||
|
self.test.or_init(|| XRTest::new(&self.global()))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl XR {
|
impl XR {
|
||||||
|
|
|
@ -98,6 +98,7 @@ WEBIDL_STANDARDS = [
|
||||||
"//wicg.github.io",
|
"//wicg.github.io",
|
||||||
"//webaudio.github.io",
|
"//webaudio.github.io",
|
||||||
"//immersive-web.github.io/",
|
"//immersive-web.github.io/",
|
||||||
|
"//github.com/immersive-web/webxr-test-api/",
|
||||||
# Not a URL
|
# Not a URL
|
||||||
"// This interface is entirely internal to Servo, and should not be" +
|
"// This interface is entirely internal to Servo, and should not be" +
|
||||||
" accessible to\n// web pages."
|
" accessible to\n// web pages."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue