aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/script/dom/bindings/codegen/Bindings.conf2
-rw-r--r--components/script/dom/mod.rs2
-rw-r--r--components/script/dom/navigator.rs8
-rw-r--r--components/script/dom/webidls/XRSystem.webidl (renamed from components/script/dom/webidls/XR.webidl)8
-rw-r--r--components/script/dom/xrsession.rs2
-rw-r--r--components/script/dom/xrsystem.rs (renamed from components/script/dom/xr.rs)30
-rw-r--r--tests/wpt/metadata/webxr/idlharness.https.window.js.ini18
-rw-r--r--tests/wpt/mozilla/meta/MANIFEST.json2
-rw-r--r--tests/wpt/mozilla/tests/mozilla/interfaces.html2
9 files changed, 30 insertions, 44 deletions
diff --git a/components/script/dom/bindings/codegen/Bindings.conf b/components/script/dom/bindings/codegen/Bindings.conf
index d60814f6191..5f978f5d3c4 100644
--- a/components/script/dom/bindings/codegen/Bindings.conf
+++ b/components/script/dom/bindings/codegen/Bindings.conf
@@ -140,7 +140,7 @@ DOMInterfaces = {
'inRealms': ['WatchAdvertisements'],
},
-'XR': {
+'XRSystem': {
'inRealms': ['SupportsSessionMode', 'RequestSession'],
},
diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs
index 2401c5a55cb..e25a88b9da2 100644
--- a/components/script/dom/mod.rs
+++ b/components/script/dom/mod.rs
@@ -573,7 +573,6 @@ pub mod xmlhttprequest;
pub mod xmlhttprequesteventtarget;
pub mod xmlhttprequestupload;
pub mod xmlserializer;
-pub mod xr;
pub mod xrframe;
pub mod xrinputsource;
pub mod xrinputsourcearray;
@@ -586,6 +585,7 @@ pub mod xrrigidtransform;
pub mod xrsession;
pub mod xrsessionevent;
pub mod xrspace;
+pub mod xrsystem;
pub mod xrtest;
pub mod xrview;
pub mod xrviewerpose;
diff --git a/components/script/dom/navigator.rs b/components/script/dom/navigator.rs
index 47bf1e6845a..690eb72abd3 100644
--- a/components/script/dom/navigator.rs
+++ b/components/script/dom/navigator.rs
@@ -20,7 +20,7 @@ use crate::dom::pluginarray::PluginArray;
use crate::dom::promise::Promise;
use crate::dom::serviceworkercontainer::ServiceWorkerContainer;
use crate::dom::window::Window;
-use crate::dom::xr::XR;
+use crate::dom::xrsystem::XRSystem;
use crate::realms::InRealm;
use dom_struct::dom_struct;
use std::rc::Rc;
@@ -32,7 +32,7 @@ pub struct Navigator {
plugins: MutNullableDom<PluginArray>,
mime_types: MutNullableDom<MimeTypeArray>,
service_worker: MutNullableDom<ServiceWorkerContainer>,
- xr: MutNullableDom<XR>,
+ xr: MutNullableDom<XRSystem>,
mediadevices: MutNullableDom<MediaDevices>,
gamepads: MutNullableDom<GamepadList>,
permissions: MutNullableDom<Permissions>,
@@ -183,8 +183,8 @@ impl NavigatorMethods for Navigator {
}
/// https://immersive-web.github.io/webxr/#dom-navigator-xr
- fn Xr(&self) -> DomRoot<XR> {
- self.xr.or_init(|| XR::new(&self.global()))
+ fn Xr(&self) -> DomRoot<XRSystem> {
+ self.xr.or_init(|| XRSystem::new(&self.global()))
}
/// https://w3c.github.io/mediacapture-main/#dom-navigator-mediadevices
diff --git a/components/script/dom/webidls/XR.webidl b/components/script/dom/webidls/XRSystem.webidl
index 1c1e880eab2..b7eeed756bb 100644
--- a/components/script/dom/webidls/XR.webidl
+++ b/components/script/dom/webidls/XRSystem.webidl
@@ -2,9 +2,9 @@
* 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/#xr-interface
+// https://immersive-web.github.io/webxr/#xrsystem-interface
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"]
-interface XR: EventTarget {
+interface XRSystem: EventTarget {
// Methods
Promise<boolean> isSessionSupported(XRSessionMode mode);
Promise<XRSession> requestSession(XRSessionMode mode, optional XRSessionInit parameters = {});
@@ -15,7 +15,7 @@ interface XR: EventTarget {
[SecureContext]
partial interface Navigator {
- [SameObject, Pref="dom.webxr.enabled"] readonly attribute XR xr;
+ [SameObject, Pref="dom.webxr.enabled"] readonly attribute XRSystem xr;
};
enum XRSessionMode {
@@ -29,7 +29,7 @@ dictionary XRSessionInit {
sequence<any> optionalFeatures;
};
-partial interface XR {
+partial interface XRSystem {
// https://github.com/immersive-web/webxr-test-api/
[SameObject, Pref="dom.webxr.test"] readonly attribute XRTest test;
};
diff --git a/components/script/dom/xrsession.rs b/components/script/dom/xrsession.rs
index 09aa2c7c854..1acc029a65b 100644
--- a/components/script/dom/xrsession.rs
+++ b/components/script/dom/xrsession.rs
@@ -7,7 +7,6 @@ use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::NavigatorBinding::NavigatorBinding::NavigatorMethods;
use crate::dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextMethods;
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowBinding::WindowMethods;
-use crate::dom::bindings::codegen::Bindings::XRBinding::XRSessionMode;
use crate::dom::bindings::codegen::Bindings::XRReferenceSpaceBinding::XRReferenceSpaceType;
use crate::dom::bindings::codegen::Bindings::XRRenderStateBinding::XRRenderStateInit;
use crate::dom::bindings::codegen::Bindings::XRRenderStateBinding::XRRenderStateMethods;
@@ -16,6 +15,7 @@ use crate::dom::bindings::codegen::Bindings::XRSessionBinding::XREnvironmentBlen
use crate::dom::bindings::codegen::Bindings::XRSessionBinding::XRFrameRequestCallback;
use crate::dom::bindings::codegen::Bindings::XRSessionBinding::XRSessionMethods;
use crate::dom::bindings::codegen::Bindings::XRSessionBinding::XRVisibilityState;
+use crate::dom::bindings::codegen::Bindings::XRSystemBinding::XRSessionMode;
use crate::dom::bindings::codegen::Bindings::XRWebGLLayerBinding::XRWebGLLayerMethods;
use crate::dom::bindings::error::{Error, ErrorResult};
use crate::dom::bindings::inheritance::Castable;
diff --git a/components/script/dom/xr.rs b/components/script/dom/xrsystem.rs
index 60ddd8ba30f..e397a4fc0b2 100644
--- a/components/script/dom/xr.rs
+++ b/components/script/dom/xrsystem.rs
@@ -4,9 +4,9 @@
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::VRDisplayBinding::VRDisplayMethods;
-use crate::dom::bindings::codegen::Bindings::XRBinding;
-use crate::dom::bindings::codegen::Bindings::XRBinding::XRSessionInit;
-use crate::dom::bindings::codegen::Bindings::XRBinding::{XRMethods, XRSessionMode};
+use crate::dom::bindings::codegen::Bindings::XRSystemBinding;
+use crate::dom::bindings::codegen::Bindings::XRSystemBinding::XRSessionInit;
+use crate::dom::bindings::codegen::Bindings::XRSystemBinding::{XRSessionMode, XRSystemMethods};
use crate::dom::bindings::conversions::{ConversionResult, FromJSValConvertible};
use crate::dom::bindings::error::Error;
use crate::dom::bindings::inheritance::Castable;
@@ -38,7 +38,7 @@ use webvr_traits::{WebVRGamepadData, WebVRGamepadEvent, WebVRGamepadState};
use webxr_api::{Error as XRError, Frame, Session, SessionInit, SessionMode};
#[dom_struct]
-pub struct XR {
+pub struct XRSystem {
eventtarget: EventTarget,
displays: DomRefCell<Vec<Dom<VRDisplay>>>,
gamepads: DomRefCell<Vec<Dom<Gamepad>>>,
@@ -48,9 +48,9 @@ pub struct XR {
test: MutNullableDom<XRTest>,
}
-impl XR {
- fn new_inherited() -> XR {
- XR {
+impl XRSystem {
+ fn new_inherited() -> XRSystem {
+ XRSystem {
eventtarget: EventTarget::new_inherited(),
displays: DomRefCell::new(Vec::new()),
gamepads: DomRefCell::new(Vec::new()),
@@ -61,8 +61,12 @@ impl XR {
}
}
- pub fn new(global: &GlobalScope) -> DomRoot<XR> {
- let root = reflect_dom_object(Box::new(XR::new_inherited()), global, XRBinding::Wrap);
+ pub fn new(global: &GlobalScope) -> DomRoot<XRSystem> {
+ let root = reflect_dom_object(
+ Box::new(XRSystem::new_inherited()),
+ global,
+ XRSystemBinding::Wrap,
+ );
root.register();
root
}
@@ -96,7 +100,7 @@ impl XR {
}
}
-impl Drop for XR {
+impl Drop for XRSystem {
fn drop(&mut self) {
self.unregister();
}
@@ -112,7 +116,7 @@ impl Into<SessionMode> for XRSessionMode {
}
}
-impl XRMethods for XR {
+impl XRSystemMethods for XRSystem {
/// https://immersive-web.github.io/webxr/#dom-xr-issessionsupported
fn IsSessionSupported(&self, mode: XRSessionMode) -> Rc<Promise> {
// XXXManishearth this should select an XR device first
@@ -267,7 +271,7 @@ impl XRMethods for XR {
}
}
-impl XR {
+impl XRSystem {
fn session_obtained(
&self,
response: Result<Session, XRError>,
@@ -442,7 +446,7 @@ impl XR {
}
// Gamepad
-impl XR {
+impl XRSystem {
fn find_gamepad(&self, gamepad_id: u32) -> Option<DomRoot<Gamepad>> {
self.gamepads
.borrow()
diff --git a/tests/wpt/metadata/webxr/idlharness.https.window.js.ini b/tests/wpt/metadata/webxr/idlharness.https.window.js.ini
index 91df7d25204..8a8492b1adf 100644
--- a/tests/wpt/metadata/webxr/idlharness.https.window.js.ini
+++ b/tests/wpt/metadata/webxr/idlharness.https.window.js.ini
@@ -131,27 +131,9 @@
[XRSystem interface: operation isSessionSupported(XRSessionMode)]
expected: FAIL
- [XRSystem interface: existence and properties of interface prototype object]
- expected: FAIL
-
- [XRSystem interface: existence and properties of interface object]
- expected: FAIL
-
- [XRSystem interface object name]
- expected: FAIL
-
[XRSystem interface: attribute ondevicechange]
expected: FAIL
- [XRSystem interface: existence and properties of interface prototype object's @@unscopables property]
- expected: FAIL
-
- [XRSystem interface: existence and properties of interface prototype object's "constructor" property]
- expected: FAIL
-
- [XRSystem interface object length]
- expected: FAIL
-
[XRSystem interface: operation requestSession(XRSessionMode, XRSessionInit)]
expected: FAIL
diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json
index e228320281b..578529efc67 100644
--- a/tests/wpt/mozilla/meta/MANIFEST.json
+++ b/tests/wpt/mozilla/meta/MANIFEST.json
@@ -13863,7 +13863,7 @@
]
],
"interfaces.html": [
- "bb6adbde0b3452e6ea8f1db44941a08dbe236774",
+ "163ab416b1627e07347b83aa210712364182343a",
[
null,
{}
diff --git a/tests/wpt/mozilla/tests/mozilla/interfaces.html b/tests/wpt/mozilla/tests/mozilla/interfaces.html
index bb6adbde0b3..163ab416b16 100644
--- a/tests/wpt/mozilla/tests/mozilla/interfaces.html
+++ b/tests/wpt/mozilla/tests/mozilla/interfaces.html
@@ -263,7 +263,6 @@ test_interfaces([
"XMLHttpRequestEventTarget",
"XMLHttpRequestUpload",
"XMLSerializer",
- "XR",
"XRFrame",
"XRInputSource",
"XRInputSourceArray",
@@ -275,6 +274,7 @@ test_interfaces([
"XRSession",
"XRSessionEvent",
"XRSpace",
+ "XRSystem",
"XRView",
"XRViewerPose",
"XRViewport",