Add empty XRInputSourceArray interface

This commit is contained in:
Manish Goregaokar 2019-10-08 14:51:05 -07:00
parent c60d4f46a0
commit b5b852be75
3 changed files with 43 additions and 0 deletions

View file

@ -549,6 +549,7 @@ pub mod xmlserializer;
pub mod xr; pub mod xr;
pub mod xrframe; pub mod xrframe;
pub mod xrinputsource; pub mod xrinputsource;
pub mod xrinputsourcearray;
pub mod xrinputsourceevent; pub mod xrinputsourceevent;
pub mod xrpose; pub mod xrpose;
pub mod xrreferencespace; pub mod xrreferencespace;

View file

@ -0,0 +1,12 @@
/* 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/#xrinputsourcearray-interface
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"]
interface XRInputSourceArray {
// iterable<XRInputSource>;
// readonly attribute unsigned long length;
// getter XRInputSource(unsigned long index);
};

View file

@ -0,0 +1,30 @@
/* 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/. */
use crate::dom::bindings::codegen::Bindings::XRInputSourceArrayBinding;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::globalscope::GlobalScope;
use dom_struct::dom_struct;
#[dom_struct]
pub struct XRInputSourceArray {
reflector_: Reflector,
}
impl XRInputSourceArray {
fn new_inherited() -> XRInputSourceArray {
XRInputSourceArray {
reflector_: Reflector::new(),
}
}
pub fn new(global: &GlobalScope) -> DomRoot<XRInputSourceArray> {
reflect_dom_object(
Box::new(XRInputSourceArray::new_inherited()),
global,
XRInputSourceArrayBinding::Wrap,
)
}
}