Auto merge of #22528 - Manishearth:webxr, r=jdm,MortimerGoro

Preliminary WebXR support

This implements just enough WebXR to display to 3DOF devices in
immersive mode only.

Couple missing things:

 - [ ] Handling reference spaces (even if just supporting eye-level spaces)
 - [x] Spec links
 - [ ] We enter immersive mode when baseLayer is set, but it seems like
we're supposed to do this when requestSession is called (https://github.com/immersive-web/webxr/issues/453)
 - [ ] VR/XR should block less (https://github.com/servo/servo/issues/22505)
 - [x] More pref-gating
 - [x] `views` is a method instead of an attribute because we don't support FrozenArray

<s>Once I add spec links and pref gating</s> this can be landed as-is for further experimentation.

r? @jdm @MortimerGoro

<!-- 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/22528)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-01-04 02:54:16 -05:00 committed by GitHub
commit c4a6dcfe4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 1092 additions and 71 deletions

View file

@ -24,6 +24,7 @@ use crate::dom::bindings::codegen::Bindings::DocumentBinding::{
DocumentMethods, DocumentReadyState,
};
use crate::dom::bindings::codegen::Bindings::EventBinding::EventInit;
use crate::dom::bindings::codegen::Bindings::NavigatorBinding::NavigatorMethods;
use crate::dom::bindings::codegen::Bindings::TransitionEventBinding::TransitionEventInit;
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
use crate::dom::bindings::conversions::{
@ -3320,8 +3321,8 @@ impl ScriptThread {
fn handle_webvr_events(&self, pipeline_id: PipelineId, events: Vec<WebVREvent>) {
let window = self.documents.borrow().find_window(pipeline_id);
if let Some(window) = window {
let vr = window.Navigator().Vr();
vr.handle_webvr_events(events);
let xr = window.Navigator().Xr();
xr.handle_webvr_events(events);
}
}