aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Jeffrey <ajeffrey@mozilla.com>2020-08-04 15:10:01 -0500
committerAlan Jeffrey <ajeffrey@mozilla.com>2020-08-04 15:10:01 -0500
commitd255dc9f7b9468aa243a43c91c8567c71afe8c60 (patch)
tree790ffd49f34a8480fc2837259c27e754fd08edc5
parent754019f6bc4cce22177abb2e6ab2ee6bfb10427c (diff)
downloadservo-d255dc9f7b9468aa243a43c91c8567c71afe8c60.tar.gz
servo-d255dc9f7b9468aa243a43c91c8567c71afe8c60.zip
Add a dummy implementation of all the XR Layer types
-rw-r--r--components/script/dom/mod.rs6
-rw-r--r--components/script/dom/webidls/XRCompositionLayer.webidl20
-rw-r--r--components/script/dom/webidls/XRCubeLayer.webidl17
-rw-r--r--components/script/dom/webidls/XRCylinderLayer.webidl20
-rw-r--r--components/script/dom/webidls/XREquirectLayer.webidl21
-rw-r--r--components/script/dom/webidls/XRLayer.webidl68
-rw-r--r--components/script/dom/webidls/XRMediaBinding.webidl8
-rw-r--r--components/script/dom/webidls/XRProjectionLayer.webidl12
-rw-r--r--components/script/dom/webidls/XRQuadLayer.webidl19
-rw-r--r--components/script/dom/webidls/XRWebGLBinding.webidl22
-rw-r--r--components/script/dom/xrcompositionlayer.rs11
-rw-r--r--components/script/dom/xrcubelayer.rs11
-rw-r--r--components/script/dom/xrcylinderlayer.rs11
-rw-r--r--components/script/dom/xrequirectlayer.rs11
-rw-r--r--components/script/dom/xrmediabinding.rs55
-rw-r--r--components/script/dom/xrprojectionlayer.rs11
-rw-r--r--components/script/dom/xrquadlayer.rs11
-rw-r--r--components/script/dom/xrwebglbinding.rs88
18 files changed, 337 insertions, 85 deletions
diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs
index 30681be0ff2..76ed789e8ad 100644
--- a/components/script/dom/mod.rs
+++ b/components/script/dom/mod.rs
@@ -599,6 +599,10 @@ pub mod xmlhttprequest;
pub mod xmlhttprequesteventtarget;
pub mod xmlhttprequestupload;
pub mod xmlserializer;
+pub mod xrcompositionlayer;
+pub mod xrcubelayer;
+pub mod xrcylinderlayer;
+pub mod xrequirectlayer;
pub mod xrframe;
pub mod xrhand;
pub mod xrhittestresult;
@@ -612,6 +616,8 @@ pub mod xrjointspace;
pub mod xrlayer;
pub mod xrmediabinding;
pub mod xrpose;
+pub mod xrprojectionlayer;
+pub mod xrquadlayer;
pub mod xrray;
pub mod xrreferencespace;
pub mod xrrenderstate;
diff --git a/components/script/dom/webidls/XRCompositionLayer.webidl b/components/script/dom/webidls/XRCompositionLayer.webidl
new file mode 100644
index 00000000000..bde8aed6cdf
--- /dev/null
+++ b/components/script/dom/webidls/XRCompositionLayer.webidl
@@ -0,0 +1,20 @@
+/* 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/. */
+
+// TODO: Implement the layer types
+// https://github.com/servo/servo/issues/27493
+
+// https://immersive-web.github.io/layers/#xrcompositionlayer
+[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
+interface XRCompositionLayer : XRLayer {
+// readonly attribute XRLayerLayout layout;
+//
+// attribute boolean blendTextureSourceAlpha;
+// attribute boolean? chromaticAberrationCorrection;
+// attribute float? fixedFoveation;
+//
+// readonly attribute boolean needsRedraw;
+//
+// void destroy();
+};
diff --git a/components/script/dom/webidls/XRCubeLayer.webidl b/components/script/dom/webidls/XRCubeLayer.webidl
new file mode 100644
index 00000000000..66e8eb18130
--- /dev/null
+++ b/components/script/dom/webidls/XRCubeLayer.webidl
@@ -0,0 +1,17 @@
+/* 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/. */
+
+// TODO: Implement the layer types
+// https://github.com/servo/servo/issues/27493
+
+// https://immersive-web.github.io/layers/#xrcubelayer
+
+[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
+interface XRCubeLayer : XRCompositionLayer {
+// attribute XRSpace space;
+// attribute DOMPointReadOnly orientation;
+//
+// // Events
+// attribute EventHandler onredraw;
+};
diff --git a/components/script/dom/webidls/XRCylinderLayer.webidl b/components/script/dom/webidls/XRCylinderLayer.webidl
new file mode 100644
index 00000000000..9a3e2d051c6
--- /dev/null
+++ b/components/script/dom/webidls/XRCylinderLayer.webidl
@@ -0,0 +1,20 @@
+/* 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/. */
+
+// TODO: Implement the layer types
+// https://github.com/servo/servo/issues/27493
+
+// https://immersive-web.github.io/layers/#xrcylinderlayer
+[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
+interface XRCylinderLayer : XRCompositionLayer {
+// attribute XRSpace space;
+// attribute XRRigidTransform transform;
+//
+// attribute float radius;
+// attribute float centralAngle;
+// attribute float aspectRatio;
+//
+// // Events
+// attribute EventHandler onredraw;
+};
diff --git a/components/script/dom/webidls/XREquirectLayer.webidl b/components/script/dom/webidls/XREquirectLayer.webidl
new file mode 100644
index 00000000000..98a82bc80dd
--- /dev/null
+++ b/components/script/dom/webidls/XREquirectLayer.webidl
@@ -0,0 +1,21 @@
+/* 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/. */
+
+// TODO: Implement the layer types
+// https://github.com/servo/servo/issues/27493
+
+// https://immersive-web.github.io/layers/#xrequirectlayer
+[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
+interface XREquirectLayer : XRCompositionLayer {
+// attribute XRSpace space;
+// attribute XRRigidTransform transform;
+//
+// attribute float radius;
+// attribute float centralHorizontalAngle;
+// attribute float upperVerticalAngle;
+// attribute float lowerVerticalAngle;
+//
+// // Events
+// attribute EventHandler onredraw;
+};
diff --git a/components/script/dom/webidls/XRLayer.webidl b/components/script/dom/webidls/XRLayer.webidl
index 60e314316dd..5f719db7bdb 100644
--- a/components/script/dom/webidls/XRLayer.webidl
+++ b/components/script/dom/webidls/XRLayer.webidl
@@ -5,71 +5,3 @@
// https://immersive-web.github.io/webxr/#xrlayer
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"]
interface XRLayer : EventTarget {};
-
-// TODO: Implement the layer types
-//
-// [SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
-// interface XRCompositionLayer : XRLayer {
-// readonly attribute XRLayerLayout layout;
-//
-// attribute boolean blendTextureSourceAlpha;
-// attribute boolean? chromaticAberrationCorrection;
-// attribute float? fixedFoveation;
-//
-// readonly attribute boolean needsRedraw;
-//
-// void destroy();
-// };
-//
-// [SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
-// interface XRProjectionLayer : XRCompositionLayer {
-// readonly attribute boolean ignoreDepthValues;
-// };
-//
-// [SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
-// interface XRQuadLayer : XRCompositionLayer {
-// attribute XRSpace space;
-// attribute XRRigidTransform transform;
-//
-// attribute float width;
-// attribute float height;
-//
-// // Events
-// attribute EventHandler onredraw;
-// };
-//
-// [SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
-// interface XRCylinderLayer : XRCompositionLayer {
-// attribute XRSpace space;
-// attribute XRRigidTransform transform;
-//
-// attribute float radius;
-// attribute float centralAngle;
-// attribute float aspectRatio;
-//
-// // Events
-// attribute EventHandler onredraw;
-// };
-//
-// [SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
-// interface XREquirectLayer : XRCompositionLayer {
-// attribute XRSpace space;
-// attribute XRRigidTransform transform;
-//
-// attribute float radius;
-// attribute float centralHorizontalAngle;
-// attribute float upperVerticalAngle;
-// attribute float lowerVerticalAngle;
-//
-// // Events
-// attribute EventHandler onredraw;
-// };
-//
-// [SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
-// interface XRCubeLayer : XRCompositionLayer {
-// attribute XRSpace space;
-// attribute DOMPointReadOnly orientation;
-//
-// // Events
-// attribute EventHandler onredraw;
-// };
diff --git a/components/script/dom/webidls/XRMediaBinding.webidl b/components/script/dom/webidls/XRMediaBinding.webidl
index 226e0653b33..87a858f098e 100644
--- a/components/script/dom/webidls/XRMediaBinding.webidl
+++ b/components/script/dom/webidls/XRMediaBinding.webidl
@@ -5,11 +5,11 @@
// https://immersive-web.github.io/layers/#xrmediabindingtype
[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
interface XRMediaBinding {
- constructor(XRSession session);
+ [Throws] constructor(XRSession session);
-// XRQuadLayer createQuadVideoLayer(HTMLVideoElement video, optional XRMediaLayerInit init = {});
-// XRCylinderLayer createCylinderVideoLayer(HTMLVideoElement video, optional XRMediaLayerInit init = {});
-// XREquirectLayer createEquirectVideoLayer(HTMLVideoElement video, optional XRMediaLayerInit init = {});
+ [Throws] XRQuadLayer createQuadLayer(HTMLVideoElement video, XRMediaLayerInit init);
+ [Throws] XRCylinderLayer createCylinderLayer(HTMLVideoElement video, XRMediaLayerInit init);
+ [Throws] XREquirectLayer createEquirectLayer(HTMLVideoElement video, XRMediaLayerInit init);
};
dictionary XRMediaLayerInit {
diff --git a/components/script/dom/webidls/XRProjectionLayer.webidl b/components/script/dom/webidls/XRProjectionLayer.webidl
new file mode 100644
index 00000000000..c96afe4c28d
--- /dev/null
+++ b/components/script/dom/webidls/XRProjectionLayer.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/. */
+
+// TODO: Implement the layer types
+// https://github.com/servo/servo/issues/27493
+
+// https://immersive-web.github.io/layers/#xrprojectionlayer
+[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
+interface XRProjectionLayer : XRCompositionLayer {
+// readonly attribute boolean ignoreDepthValues;
+};
diff --git a/components/script/dom/webidls/XRQuadLayer.webidl b/components/script/dom/webidls/XRQuadLayer.webidl
new file mode 100644
index 00000000000..78c513ecdb9
--- /dev/null
+++ b/components/script/dom/webidls/XRQuadLayer.webidl
@@ -0,0 +1,19 @@
+/* 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/. */
+
+// TODO: Implement the layer types
+// https://github.com/servo/servo/issues/27493
+
+// https://immersive-web.github.io/layers/#xrquadlayer
+[SecureContext, Exposed=Window, Pref="dom.webxr.layers.enabled"]
+interface XRQuadLayer : XRCompositionLayer {
+// attribute XRSpace space;
+// attribute XRRigidTransform transform;
+//
+// attribute float width;
+// attribute float height;
+//
+// // Events
+// attribute EventHandler onredraw;
+};
diff --git a/components/script/dom/webidls/XRWebGLBinding.webidl b/components/script/dom/webidls/XRWebGLBinding.webidl
index c57b59b7afc..5823423ef86 100644
--- a/components/script/dom/webidls/XRWebGLBinding.webidl
+++ b/components/script/dom/webidls/XRWebGLBinding.webidl
@@ -9,18 +9,18 @@ interface XRWebGLBinding {
// readonly attribute double nativeProjectionScaleFactor;
-// XRProjectionLayer createProjectionLayer(XRTextureType textureType,
-// optional XRProjectionLayerInit init);
-// XRQuadLayer createQuadLayer(XRTextureType textureType,
-// optional XRQuadLayerInit init);
-// XRCylinderLayer createCylinderLayer(XRTextureType textureType,
-// optional XRCylinderLayerInit init);
-// XREquirectLayer createEquirectLayer(XRTextureType textureType,
-// optional XREquirectLayerInit init);
-// XRCubeLayer createCubeLayer(optional XRCubeLayerInit init);
+ [Throws] XRProjectionLayer createProjectionLayer(XRTextureType textureType,
+ optional XRProjectionLayerInit init = {});
+ [Throws] XRQuadLayer createQuadLayer(XRTextureType textureType,
+ optional XRQuadLayerInit init);
+ [Throws] XRCylinderLayer createCylinderLayer(XRTextureType textureType,
+ optional XRCylinderLayerInit init);
+ [Throws] XREquirectLayer createEquirectLayer(XRTextureType textureType,
+ optional XREquirectLayerInit init);
+ [Throws] XRCubeLayer createCubeLayer(optional XRCubeLayerInit init);
-// XRWebGLSubImage getSubImage(XRCompositionLayer layer, XRFrame frame, optional XREye eye = "none");
-// XRWebGLSubImage getViewSubImage(XRProjectionLayer layer, XRView view);
+ [Throws] XRWebGLSubImage getSubImage(XRCompositionLayer layer, XRFrame frame, optional XREye eye = "none");
+ [Throws] XRWebGLSubImage getViewSubImage(XRProjectionLayer layer, XRView view);
};
dictionary XRProjectionLayerInit {
diff --git a/components/script/dom/xrcompositionlayer.rs b/components/script/dom/xrcompositionlayer.rs
new file mode 100644
index 00000000000..5a4aa85d2fa
--- /dev/null
+++ b/components/script/dom/xrcompositionlayer.rs
@@ -0,0 +1,11 @@
+/* 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::xrlayer::XRLayer;
+use dom_struct::dom_struct;
+
+#[dom_struct]
+pub struct XRCompositionLayer {
+ xr_layer: XRLayer,
+}
diff --git a/components/script/dom/xrcubelayer.rs b/components/script/dom/xrcubelayer.rs
new file mode 100644
index 00000000000..71296ddc238
--- /dev/null
+++ b/components/script/dom/xrcubelayer.rs
@@ -0,0 +1,11 @@
+/* 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::xrcompositionlayer::XRCompositionLayer;
+use dom_struct::dom_struct;
+
+#[dom_struct]
+pub struct XRCubeLayer {
+ composition_layer: XRCompositionLayer,
+}
diff --git a/components/script/dom/xrcylinderlayer.rs b/components/script/dom/xrcylinderlayer.rs
new file mode 100644
index 00000000000..2abe935f525
--- /dev/null
+++ b/components/script/dom/xrcylinderlayer.rs
@@ -0,0 +1,11 @@
+/* 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::xrcompositionlayer::XRCompositionLayer;
+use dom_struct::dom_struct;
+
+#[dom_struct]
+pub struct XRCylinderLayer {
+ composition_layer: XRCompositionLayer,
+}
diff --git a/components/script/dom/xrequirectlayer.rs b/components/script/dom/xrequirectlayer.rs
new file mode 100644
index 00000000000..d6da61a5a9c
--- /dev/null
+++ b/components/script/dom/xrequirectlayer.rs
@@ -0,0 +1,11 @@
+/* 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::xrcompositionlayer::XRCompositionLayer;
+use dom_struct::dom_struct;
+
+#[dom_struct]
+pub struct XREquirectLayer {
+ composition_layer: XRCompositionLayer,
+}
diff --git a/components/script/dom/xrmediabinding.rs b/components/script/dom/xrmediabinding.rs
index b0b6a0ac69c..5e1dfd3abeb 100644
--- a/components/script/dom/xrmediabinding.rs
+++ b/components/script/dom/xrmediabinding.rs
@@ -2,11 +2,19 @@
* 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::XRMediaBindingBinding::XRMediaBindingBinding::XRMediaBindingMethods;
+use crate::dom::bindings::codegen::Bindings::XRMediaBindingBinding::XRMediaLayerInit;
+use crate::dom::bindings::error::Error;
+use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::reflector::reflect_dom_object;
use crate::dom::bindings::reflector::Reflector;
use crate::dom::bindings::root::Dom;
use crate::dom::bindings::root::DomRoot;
+use crate::dom::htmlvideoelement::HTMLVideoElement;
use crate::dom::window::Window;
+use crate::dom::xrcylinderlayer::XRCylinderLayer;
+use crate::dom::xrequirectlayer::XREquirectLayer;
+use crate::dom::xrquadlayer::XRQuadLayer;
use crate::dom::xrsession::XRSession;
use dom_struct::dom_struct;
@@ -29,7 +37,50 @@ impl XRMediaBinding {
}
#[allow(non_snake_case)]
- pub fn Constructor(global: &Window, session: &XRSession) -> DomRoot<XRMediaBinding> {
- XRMediaBinding::new(global, session)
+ pub fn Constructor(global: &Window, session: &XRSession) -> Fallible<DomRoot<XRMediaBinding>> {
+ // Step 1.
+ if session.is_ended() {
+ return Err(Error::InvalidState);
+ }
+
+ // Step 2.
+ if !session.is_immersive() {
+ return Err(Error::InvalidState);
+ }
+
+ // Steps 3-5.
+ Ok(XRMediaBinding::new(global, session))
+ }
+}
+
+impl XRMediaBindingMethods for XRMediaBinding {
+ /// https://immersive-web.github.io/layers/#dom-xrmediabinding-createquadlayer
+ fn CreateQuadLayer(
+ &self,
+ _: &HTMLVideoElement,
+ _: &XRMediaLayerInit,
+ ) -> Fallible<DomRoot<XRQuadLayer>> {
+ // https://github.com/servo/servo/issues/27493
+ Err(Error::NotSupported)
+ }
+
+ /// https://immersive-web.github.io/layers/#dom-xrmediabinding-createcylinderlayer
+ fn CreateCylinderLayer(
+ &self,
+ _: &HTMLVideoElement,
+ _: &XRMediaLayerInit,
+ ) -> Fallible<DomRoot<XRCylinderLayer>> {
+ // https://github.com/servo/servo/issues/27493
+ Err(Error::NotSupported)
+ }
+
+ /// https://immersive-web.github.io/layers/#dom-xrmediabinding-createequirectlayer
+ fn CreateEquirectLayer(
+ &self,
+ _: &HTMLVideoElement,
+ _: &XRMediaLayerInit,
+ ) -> Fallible<DomRoot<XREquirectLayer>> {
+ // https://github.com/servo/servo/issues/27493
+ Err(Error::NotSupported)
}
}
diff --git a/components/script/dom/xrprojectionlayer.rs b/components/script/dom/xrprojectionlayer.rs
new file mode 100644
index 00000000000..f5d6f68de67
--- /dev/null
+++ b/components/script/dom/xrprojectionlayer.rs
@@ -0,0 +1,11 @@
+/* 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::xrcompositionlayer::XRCompositionLayer;
+use dom_struct::dom_struct;
+
+#[dom_struct]
+pub struct XRProjectionLayer {
+ composition_layer: XRCompositionLayer,
+}
diff --git a/components/script/dom/xrquadlayer.rs b/components/script/dom/xrquadlayer.rs
new file mode 100644
index 00000000000..86358a7d7b5
--- /dev/null
+++ b/components/script/dom/xrquadlayer.rs
@@ -0,0 +1,11 @@
+/* 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::xrcompositionlayer::XRCompositionLayer;
+use dom_struct::dom_struct;
+
+#[dom_struct]
+pub struct XRQuadLayer {
+ composition_layer: XRCompositionLayer,
+}
diff --git a/components/script/dom/xrwebglbinding.rs b/components/script/dom/xrwebglbinding.rs
index a0c4846074b..64ea31e0bce 100644
--- a/components/script/dom/xrwebglbinding.rs
+++ b/components/script/dom/xrwebglbinding.rs
@@ -2,14 +2,33 @@
* 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::XRViewBinding::XREye;
+use crate::dom::bindings::codegen::Bindings::XRWebGLBindingBinding::XRCubeLayerInit;
+use crate::dom::bindings::codegen::Bindings::XRWebGLBindingBinding::XRCylinderLayerInit;
+use crate::dom::bindings::codegen::Bindings::XRWebGLBindingBinding::XREquirectLayerInit;
+use crate::dom::bindings::codegen::Bindings::XRWebGLBindingBinding::XRProjectionLayerInit;
+use crate::dom::bindings::codegen::Bindings::XRWebGLBindingBinding::XRQuadLayerInit;
+use crate::dom::bindings::codegen::Bindings::XRWebGLBindingBinding::XRTextureType;
+use crate::dom::bindings::codegen::Bindings::XRWebGLBindingBinding::XRWebGLBindingBinding::XRWebGLBindingMethods;
use crate::dom::bindings::codegen::UnionTypes::WebGLRenderingContextOrWebGL2RenderingContext;
+use crate::dom::bindings::error::Error;
+use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::reflector::reflect_dom_object;
use crate::dom::bindings::reflector::Reflector;
use crate::dom::bindings::root::Dom;
use crate::dom::bindings::root::DomRoot;
use crate::dom::webglrenderingcontext::WebGLRenderingContext;
use crate::dom::window::Window;
+use crate::dom::xrcompositionlayer::XRCompositionLayer;
+use crate::dom::xrcubelayer::XRCubeLayer;
+use crate::dom::xrcylinderlayer::XRCylinderLayer;
+use crate::dom::xrequirectlayer::XREquirectLayer;
+use crate::dom::xrframe::XRFrame;
+use crate::dom::xrprojectionlayer::XRProjectionLayer;
+use crate::dom::xrquadlayer::XRQuadLayer;
use crate::dom::xrsession::XRSession;
+use crate::dom::xrview::XRView;
+use crate::dom::xrwebglsubimage::XRWebGLSubImage;
use dom_struct::dom_struct;
#[dom_struct]
@@ -54,3 +73,72 @@ impl XRWebGLBinding {
XRWebGLBinding::new(global, session, &context)
}
}
+
+impl XRWebGLBindingMethods for XRWebGLBinding {
+ /// https://immersive-web.github.io/layers/#dom-xrwebglbinding-createprojectionlayer
+ fn CreateProjectionLayer(
+ &self,
+ _: XRTextureType,
+ _: &XRProjectionLayerInit,
+ ) -> Fallible<DomRoot<XRProjectionLayer>> {
+ // https://github.com/servo/servo/issues/27468
+ Err(Error::NotSupported)
+ }
+
+ /// https://immersive-web.github.io/layers/#dom-xrwebglbinding-createquadlayer
+ fn CreateQuadLayer(
+ &self,
+ _: XRTextureType,
+ _: &Option<XRQuadLayerInit>,
+ ) -> Fallible<DomRoot<XRQuadLayer>> {
+ // https://github.com/servo/servo/issues/27493
+ Err(Error::NotSupported)
+ }
+
+ /// https://immersive-web.github.io/layers/#dom-xrwebglbinding-createcylinderlayer
+ fn CreateCylinderLayer(
+ &self,
+ _: XRTextureType,
+ _: &Option<XRCylinderLayerInit>,
+ ) -> Fallible<DomRoot<XRCylinderLayer>> {
+ // https://github.com/servo/servo/issues/27493
+ Err(Error::NotSupported)
+ }
+
+ /// https://immersive-web.github.io/layers/#dom-xrwebglbinding-createequirectlayer
+ fn CreateEquirectLayer(
+ &self,
+ _: XRTextureType,
+ _: &Option<XREquirectLayerInit>,
+ ) -> Fallible<DomRoot<XREquirectLayer>> {
+ // https://github.com/servo/servo/issues/27493
+ Err(Error::NotSupported)
+ }
+
+ /// https://immersive-web.github.io/layers/#dom-xrwebglbinding-createcubelayer
+ fn CreateCubeLayer(&self, _: &Option<XRCubeLayerInit>) -> Fallible<DomRoot<XRCubeLayer>> {
+ // https://github.com/servo/servo/issues/27493
+ Err(Error::NotSupported)
+ }
+
+ /// https://immersive-web.github.io/layers/#dom-xrwebglbinding-getsubimage
+ fn GetSubImage(
+ &self,
+ _: &XRCompositionLayer,
+ _: &XRFrame,
+ _: XREye,
+ ) -> Fallible<DomRoot<XRWebGLSubImage>> {
+ // https://github.com/servo/servo/issues/27468
+ Err(Error::NotSupported)
+ }
+
+ /// https://immersive-web.github.io/layers/#dom-xrwebglbinding-getviewsubimage
+ fn GetViewSubImage(
+ &self,
+ _: &XRProjectionLayer,
+ _: &XRView,
+ ) -> Fallible<DomRoot<XRWebGLSubImage>> {
+ // https://github.com/servo/servo/issues/27468
+ Err(Error::NotSupported)
+ }
+}