diff options
Diffstat (limited to 'components/script/dom/vrdisplay.rs')
-rw-r--r-- | components/script/dom/vrdisplay.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/components/script/dom/vrdisplay.rs b/components/script/dom/vrdisplay.rs index 3bcfbddd3b9..ec8af380ab9 100644 --- a/components/script/dom/vrdisplay.rs +++ b/components/script/dom/vrdisplay.rs @@ -341,8 +341,9 @@ impl VRDisplayMethods for VRDisplay { } // https://w3c.github.io/webvr/#dom-vrdisplay-requestpresent + #[allow(unsafe_code)] fn RequestPresent(&self, layers: Vec<VRLayer>) -> Rc<Promise> { - let promise = Promise::new(&self.global()); + let promise = unsafe {Promise::new_in_current_compartment(&self.global()) }; // TODO: WebVR spec: this method must be called in response to a user gesture // WebVR spec: If canPresent is false the promise MUST be rejected @@ -405,8 +406,9 @@ impl VRDisplayMethods for VRDisplay { } // https://w3c.github.io/webvr/#dom-vrdisplay-exitpresent + #[allow(unsafe_code)] fn ExitPresent(&self) -> Rc<Promise> { - let promise = Promise::new(&self.global()); + let promise = unsafe { Promise::new_in_current_compartment(&self.global()) }; // WebVR spec: If the VRDisplay is not presenting the promise MUST be rejected. if !self.presenting.get() { |