Auto merge of #24397 - Manishearth:inputarray, r=jdm

Support new way of doing input source arrays

Fixes https://github.com/servo/servo/issues/24395

r? @jdm

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24397)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-10-08 21:16:10 -04:00 committed by GitHub
commit ec408e9a57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 110 additions and 61 deletions

View file

@ -0,0 +1,12 @@
/* 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/#xrinputsourcearray-interface
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"]
interface XRInputSourceArray {
iterable<XRInputSource>;
readonly attribute unsigned long length;
getter XRInputSource(unsigned long index);
};

View file

@ -16,31 +16,26 @@ callback XRFrameRequestCallback = void (DOMHighResTimeStamp time, XRFrame frame)
interface XRSession : EventTarget {
// // Attributes
readonly attribute XRSessionMode mode;
// readonly attribute XRPresentationContext outputContext;
readonly attribute XREnvironmentBlendMode environmentBlendMode;
readonly attribute XRRenderState renderState;
// readonly attribute XRVisibilityState visibilityState;
[SameObject] readonly attribute XRRenderState renderState;
[SameObject] readonly attribute XRInputSourceArray inputSources;
// // Methods
[Throws] void updateRenderState(optional XRRenderStateInit state = {});
Promise<XRReferenceSpace> requestReferenceSpace(XRReferenceSpaceType type);
// workaround until we have FrozenArray
// see https://github.com/servo/servo/issues/10427#issuecomment-449593626
// FrozenArray<XRInputSource> getInputSources();
sequence<XRInputSource> getInputSources();
[Throws] void updateRenderState(optional XRRenderStateInit state = {});
long requestAnimationFrame(XRFrameRequestCallback callback);
void cancelAnimationFrame(long handle);
Promise<void> end();
// // Events
// attribute EventHandler onblur;
// attribute EventHandler onfocus;
attribute EventHandler onend;
attribute EventHandler onselect;
// attribute EventHandler oninputsourceschange;
attribute EventHandler onselectstart;
attribute EventHandler onselectend;
// attribute EventHandler onvisibilitychange;
};