mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Add empty XRInputSourceArray interface
This commit is contained in:
parent
c60d4f46a0
commit
b5b852be75
3 changed files with 43 additions and 0 deletions
|
@ -549,6 +549,7 @@ pub mod xmlserializer;
|
|||
pub mod xr;
|
||||
pub mod xrframe;
|
||||
pub mod xrinputsource;
|
||||
pub mod xrinputsourcearray;
|
||||
pub mod xrinputsourceevent;
|
||||
pub mod xrpose;
|
||||
pub mod xrreferencespace;
|
||||
|
|
12
components/script/dom/webidls/XRInputSourceArray.webidl
Normal file
12
components/script/dom/webidls/XRInputSourceArray.webidl
Normal 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);
|
||||
};
|
30
components/script/dom/xrinputsourcearray.rs
Normal file
30
components/script/dom/xrinputsourcearray.rs
Normal 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,
|
||||
)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue