mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
webxr: Update XRPose interface to latest spec (#33146)
* Update XRPose interface with missing members Signed-off-by: Daniel Adams <msub2official@gmail.com> * ./mach fmt Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
This commit is contained in:
parent
8e224cb4d3
commit
fb22dfb373
4 changed files with 25 additions and 20 deletions
|
@ -6,6 +6,9 @@
|
||||||
|
|
||||||
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"]
|
[SecureContext, Exposed=Window, Pref="dom.webxr.enabled"]
|
||||||
interface XRPose {
|
interface XRPose {
|
||||||
readonly attribute XRRigidTransform transform;
|
[SameObject] readonly attribute XRRigidTransform transform;
|
||||||
// readonly attribute boolean emulatedPosition;
|
[SameObject] readonly attribute DOMPointReadOnly? linearVelocity;
|
||||||
|
[SameObject] readonly attribute DOMPointReadOnly? angularVelocity;
|
||||||
|
|
||||||
|
readonly attribute boolean emulatedPosition;
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,6 +7,7 @@ use dom_struct::dom_struct;
|
||||||
use crate::dom::bindings::codegen::Bindings::XRPoseBinding::XRPoseMethods;
|
use crate::dom::bindings::codegen::Bindings::XRPoseBinding::XRPoseMethods;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
use crate::dom::bindings::root::{Dom, DomRoot};
|
use crate::dom::bindings::root::{Dom, DomRoot};
|
||||||
|
use crate::dom::dompointreadonly::DOMPointReadOnly;
|
||||||
use crate::dom::globalscope::GlobalScope;
|
use crate::dom::globalscope::GlobalScope;
|
||||||
use crate::dom::xrrigidtransform::XRRigidTransform;
|
use crate::dom::xrrigidtransform::XRRigidTransform;
|
||||||
use crate::dom::xrsession::ApiRigidTransform;
|
use crate::dom::xrsession::ApiRigidTransform;
|
||||||
|
@ -37,4 +38,23 @@ impl XRPoseMethods for XRPose {
|
||||||
fn Transform(&self) -> DomRoot<XRRigidTransform> {
|
fn Transform(&self) -> DomRoot<XRRigidTransform> {
|
||||||
DomRoot::from_ref(&self.transform)
|
DomRoot::from_ref(&self.transform)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <https://www.w3.org/TR/webxr/#dom-xrpose-linearvelocity>
|
||||||
|
fn GetLinearVelocity(&self) -> Option<DomRoot<DOMPointReadOnly>> {
|
||||||
|
// TODO: Expose from webxr crate
|
||||||
|
None
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <https://www.w3.org/TR/webxr/#dom-xrpose-angularvelocity>
|
||||||
|
fn GetAngularVelocity(&self) -> Option<DomRoot<DOMPointReadOnly>> {
|
||||||
|
// TODO: Expose from webxr crate
|
||||||
|
None
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <https://www.w3.org/TR/webxr/#dom-xrpose-emulatedposition>
|
||||||
|
fn EmulatedPosition(&self) -> bool {
|
||||||
|
// There are currently no instances in which we would need to rely
|
||||||
|
// on emulation for reporting pose, so return false.
|
||||||
|
false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,6 @@
|
||||||
[XRRay interface object length]
|
[XRRay interface object length]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[XRPose interface: attribute emulatedPosition]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[XRBoundedReferenceSpace interface object length]
|
[XRBoundedReferenceSpace interface object length]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -317,12 +314,6 @@
|
||||||
[XRSession interface: calling cancelAnimationFrame(unsigned long) on xrSession with too few arguments must throw TypeError]
|
[XRSession interface: calling cancelAnimationFrame(unsigned long) on xrSession with too few arguments must throw TypeError]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[XRPose interface: attribute linearVelocity]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[XRPose interface: attribute angularVelocity]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[XRWebGLLayer interface: attribute fixedFoveation]
|
[XRWebGLLayer interface: attribute fixedFoveation]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -41,9 +41,6 @@
|
||||||
[XRSession interface: xrSession must inherit property "onend" with the proper type]
|
[XRSession interface: xrSession must inherit property "onend" with the proper type]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[XRPose interface: attribute emulatedPosition]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[XRInputSourcesChangeEvent must be primary interface of xrInputSourcesChangeEvent]
|
[XRInputSourcesChangeEvent must be primary interface of xrInputSourcesChangeEvent]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -260,12 +257,6 @@
|
||||||
[XRSession interface: calling cancelAnimationFrame(unsigned long) on xrSession with too few arguments must throw TypeError]
|
[XRSession interface: calling cancelAnimationFrame(unsigned long) on xrSession with too few arguments must throw TypeError]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[XRPose interface: attribute linearVelocity]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[XRPose interface: attribute angularVelocity]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[XRWebGLLayer interface: attribute fixedFoveation]
|
[XRWebGLLayer interface: attribute fixedFoveation]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue