aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/xr.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2020-02-16 03:10:56 -0500
committerGitHub <noreply@github.com>2020-02-16 03:10:56 -0500
commitea7e753cea36e9dec7a2745c14364e3bbc9db4a0 (patch)
tree53f8ae2119fd479f025ab1794c4a8325da324e0b /components/script/dom/xr.rs
parent3475790fc23f939560f546901bf3082ebf20508a (diff)
parent09a23b0cb1827ec4a727c668968a4cb8933280f4 (diff)
downloadservo-ea7e753cea36e9dec7a2745c14364e3bbc9db4a0.tar.gz
servo-ea7e753cea36e9dec7a2745c14364e3bbc9db4a0.zip
Auto merge of #25773 - Manishearth:input-sources-change, r=jdm
Always trigger an input sources change event on session creation Fixes our behavior to match the spec, and to specifically do it in a way that makes sense. This is also what Chromium does currently, though I'm not sure if it does the scheduling the same way. The spec for this may change, see https://github.com/immersive-web/webxr/issues/961. This fix, along with https://github.com/servo/servo/pull/25770 , makes three.js content work on servo. Instead of this fix we can also wait for https://github.com/mrdoob/three.js/issues/18638 to land (which isn't certain until we figure out more about https://github.com/immersive-web/webxr/issues/961 ) Even if https://github.com/immersive-web/webxr/issues/961 decides to choose the option that obviates this patch, we should probably keep it for now since there's already content out in the wild relying on this behavior. r? @jdm @asajeffrey
Diffstat (limited to 'components/script/dom/xr.rs')
-rw-r--r--components/script/dom/xr.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/components/script/dom/xr.rs b/components/script/dom/xr.rs
index 2356083687f..60ddd8ba30f 100644
--- a/components/script/dom/xr.rs
+++ b/components/script/dom/xr.rs
@@ -285,7 +285,6 @@ impl XR {
return;
},
};
-
let session = XRSession::new(&self.global(), session, mode, frame_receiver);
if mode == XRSessionMode::Inline {
self.active_inline_sessions
@@ -295,6 +294,9 @@ impl XR {
self.set_active_immersive_session(&session);
}
promise.resolve_native(&session);
+ // https://github.com/immersive-web/webxr/issues/961
+ // This must be called _after_ the promise is resolved
+ session.setup_initial_inputs();
}
pub fn get_displays(&self) -> Result<Vec<DomRoot<VRDisplay>>, ()> {