Move VR interface to XR

The WebVR spec no longer has a navigator.vr, but there is a navigator.XR in the XR spec. Instead of duplicating work I've combined the two.
This commit is contained in:
Manish Goregaokar 2018-12-19 14:17:14 -08:00
parent c553c43ba1
commit 376426a936
6 changed files with 55 additions and 42 deletions

View file

@ -1,11 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://w3c.github.io/webvr/#interface-navigator
[NoInterfaceObject]
interface VR {
[Pref="dom.webvr.enabled"]
Promise<sequence<VRDisplay>> getDisplays();
//readonly attribute FrozenArray<VRDisplay> activeVRDisplays;
};

View file

@ -0,0 +1,30 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://immersive-web.github.io/webxr/#xr-interface
[SecureContext, Exposed=Window]
interface XR: EventTarget {
// Methods
// Promise<void> supportsSessionMode(XRSessionMode mode);
// Promise<XRSession> requestSession(optional XRSessionCreationOptions parameters);
// Events
// attribute EventHandler ondevicechange;
};
[SecureContext]
partial interface Navigator {
[SameObject, Pref="dom.webvr.enabled"] readonly attribute XR xr;
};
enum XRSessionMode {
"inline",
"immersive-vr",
"immersive-ar"
};
dictionary XRSessionCreationOptions {
XRSessionMode mode = "inline";
// XRPresentationContext outputContext;
};