webxr: Update XRView to latest spec (#33145)

* Add recommendedViewportScale and requestViewportScale

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Remove currently unused internal slots

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
This commit is contained in:
Daniel Adams 2024-08-20 16:37:58 -10:00 committed by GitHub
parent 75b817cca3
commit 8e224cb4d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 47 additions and 194 deletions

View file

@ -316,7 +316,7 @@ impl XRWebGLLayerMethods for XRWebGLLayer {
let index = view.viewport_index();
let viewport = self.session().with_session(|s| {
// Inline sssions
// Inline sessions
if s.viewports().is_empty() {
Rect::from_size(self.size().to_i32())
} else {
@ -324,6 +324,11 @@ impl XRWebGLLayerMethods for XRWebGLLayer {
}
});
// NOTE: According to spec, viewport sizes should be recalculated here if the
// requested viewport scale has changed. However, existing browser implementations
// don't seem to do this for stereoscopic immersive sessions.
// Revisit if Servo gets support for handheld AR/VR via ARCore/ARKit
Some(XRViewport::new(&self.global(), viewport))
}
}