mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
More CanGc fixes (#33888)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
This commit is contained in:
parent
720d632170
commit
9c893c7f4d
25 changed files with 102 additions and 58 deletions
|
@ -127,14 +127,21 @@ impl XRRigidTransformMethods for XRRigidTransform {
|
|||
}
|
||||
|
||||
// https://immersive-web.github.io/webxr/#dom-xrrigidtransform-position
|
||||
fn Position(&self) -> DomRoot<DOMPointReadOnly> {
|
||||
fn Position(&self, can_gc: CanGc) -> DomRoot<DOMPointReadOnly> {
|
||||
self.position.or_init(|| {
|
||||
let t = &self.transform.translation;
|
||||
DOMPointReadOnly::new(&self.global(), t.x.into(), t.y.into(), t.z.into(), 1.0)
|
||||
DOMPointReadOnly::new(
|
||||
&self.global(),
|
||||
t.x.into(),
|
||||
t.y.into(),
|
||||
t.z.into(),
|
||||
1.0,
|
||||
can_gc,
|
||||
)
|
||||
})
|
||||
}
|
||||
// https://immersive-web.github.io/webxr/#dom-xrrigidtransform-orientation
|
||||
fn Orientation(&self) -> DomRoot<DOMPointReadOnly> {
|
||||
fn Orientation(&self, can_gc: CanGc) -> DomRoot<DOMPointReadOnly> {
|
||||
self.orientation.or_init(|| {
|
||||
let r = &self.transform.rotation;
|
||||
DOMPointReadOnly::new(
|
||||
|
@ -143,6 +150,7 @@ impl XRRigidTransformMethods for XRRigidTransform {
|
|||
r.j.into(),
|
||||
r.k.into(),
|
||||
r.r.into(),
|
||||
can_gc,
|
||||
)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue