Auto merge of #23814 - Manishearth:events, r=asajeffrey

Partial support for events in WebXR

Needs https://github.com/servo/webxr/pull/20

r? @asajeffrey

<!-- 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/23814)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-07-23 09:44:59 -04:00 committed by GitHub
commit 7afe2153e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 299 additions and 108 deletions

View file

@ -1,8 +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://immersive-web.github.io/webxr/#xrlayer-interface
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"]
interface XRLayer {};

View file

@ -7,11 +7,11 @@
dictionary XRRenderStateInit {
double depthNear;
double depthFar;
XRLayer baseLayer;
XRWebGLLayer baseLayer;
};
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"] interface XRRenderState {
readonly attribute double depthNear;
readonly attribute double depthFar;
readonly attribute XRLayer? baseLayer;
readonly attribute XRWebGLLayer? baseLayer;
};

View file

@ -29,7 +29,7 @@ interface XRSession : EventTarget {
// FrozenArray<XRInputSource> getInputSources();
sequence<XRInputSource> getInputSources();
void updateRenderState(optional XRRenderStateInit state = {});
[Throws] void updateRenderState(optional XRRenderStateInit state = {});
long requestAnimationFrame(XRFrameRequestCallback callback);
void cancelAnimationFrame(long handle);
@ -38,7 +38,7 @@ interface XRSession : EventTarget {
// // Events
// attribute EventHandler onblur;
// attribute EventHandler onfocus;
// attribute EventHandler onend;
attribute EventHandler onend;
// attribute EventHandler onselect;
// attribute EventHandler oninputsourceschange;
// attribute EventHandler onselectstart;

View file

@ -0,0 +1,15 @@
/* 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/#xrsessionevent-interface
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled", Constructor
(DOMString type, XRSessionEventInit eventInitDict)]
interface XRSessionEvent : Event {
[SameObject] readonly attribute XRSession session;
};
dictionary XRSessionEventInit : EventInit {
required XRSession session;
};

View file

@ -21,7 +21,7 @@ dictionary XRWebGLLayerInit {
XRWebGLRenderingContext context,
optional XRWebGLLayerInit layerInit = {}),
Pref="dom.webxr.enabled"]
interface XRWebGLLayer : XRLayer {
interface XRWebGLLayer {
// // Attributes
readonly attribute XRWebGLRenderingContext context;