aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2019-10-08 14:51:05 -0700
committerManish Goregaokar <manishsmail@gmail.com>2019-10-08 15:34:20 -0700
commitb5b852be757b65bc72efb73bf8f10d698f5e009f (patch)
tree48b72a4050ca06f590c534b8b3596fd731cab205 /components/script
parentc60d4f46a07dc00d4afeb7c61b2051dedbee7bb1 (diff)
downloadservo-b5b852be757b65bc72efb73bf8f10d698f5e009f.tar.gz
servo-b5b852be757b65bc72efb73bf8f10d698f5e009f.zip
Add empty XRInputSourceArray interface
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/mod.rs1
-rw-r--r--components/script/dom/webidls/XRInputSourceArray.webidl12
-rw-r--r--components/script/dom/xrinputsourcearray.rs30
3 files changed, 43 insertions, 0 deletions
diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs
index 598832403e0..36adbbe4725 100644
--- a/components/script/dom/mod.rs
+++ b/components/script/dom/mod.rs
@@ -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;
diff --git a/components/script/dom/webidls/XRInputSourceArray.webidl b/components/script/dom/webidls/XRInputSourceArray.webidl
new file mode 100644
index 00000000000..939371bf417
--- /dev/null
+++ b/components/script/dom/webidls/XRInputSourceArray.webidl
@@ -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);
+};
diff --git a/components/script/dom/xrinputsourcearray.rs b/components/script/dom/xrinputsourcearray.rs
new file mode 100644
index 00000000000..d0d4a747052
--- /dev/null
+++ b/components/script/dom/xrinputsourcearray.rs
@@ -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,
+ )
+ }
+}