Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add input mocking, input sources change event #25463

Merged
merged 15 commits into from Jan 9, 2020

Add a realm

  • Loading branch information
Manishearth committed Jan 9, 2020
commit c89f79b132e0bf2a5ad3462f2ce695039dec67a2
@@ -2,6 +2,7 @@
* 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/. */

use crate::compartments::enter_realm;
use crate::dom::bindings::codegen::Bindings::EventBinding::EventBinding::EventMethods;
use crate::dom::bindings::codegen::Bindings::XRInputSourcesChangeEventBinding::{
self, XRInputSourcesChangeEventMethods,
@@ -62,7 +63,7 @@ impl XRInputSourcesChangeEvent {
let event = changeevent.upcast::<Event>();
event.init_event(type_, bubbles, cancelable);
}

let _ac = enter_realm(&*global);
let cx = global.get_cx();
unsafe {
rooted!(in(*cx) let mut added_val = UndefinedValue());
@@ -2,6 +2,7 @@
* 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/. */

use crate::compartments::enter_realm;
use crate::dom::bindings::codegen::Bindings::XRViewBinding::XREye;
use crate::dom::bindings::codegen::Bindings::XRViewerPoseBinding;
use crate::dom::bindings::codegen::Bindings::XRViewerPoseBinding::XRViewerPoseMethods;
@@ -40,6 +41,7 @@ impl XRViewerPose {
session: &XRSession,
pose: ApiViewerPose,
) -> DomRoot<XRViewerPose> {
let _ac = enter_realm(&*global);
rooted_vec!(let mut views);
session.with_session(|s| match s.views() {
Views::Inline => views.push(XRView::new(
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.