mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
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:
parent
c553c43ba1
commit
376426a936
6 changed files with 55 additions and 42 deletions
|
@ -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;
|
||||
};
|
30
components/script/dom/webidls/XR.webidl
Normal file
30
components/script/dom/webidls/XR.webidl
Normal 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;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue