webxr: Update XRSession to latest spec (#33059)

* Add missing XRSession members, initial implementations

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

* Implement supportedFramerates getter

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

* Implement framerate changes, add spec links

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

* Update WPT expectations

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

* ./mach fmt

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

* Add missing spec link

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-16 17:36:52 -10:00 committed by GitHub
parent f0045a7686
commit 20273b062a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 132 additions and 62 deletions

View file

@ -27,11 +27,16 @@ callback XRFrameRequestCallback = undefined (DOMHighResTimeStamp time, XRFrame f
interface XRSession : EventTarget {
// Attributes
readonly attribute XRVisibilityState visibilityState;
readonly attribute float? frameRate;
readonly attribute Float32Array? supportedFrameRates;
[SameObject] readonly attribute XRRenderState renderState;
[SameObject] readonly attribute XRInputSourceArray inputSources;
readonly attribute /*FrozenArray<DOMString>*/ any enabledFeatures;
readonly attribute boolean isSystemKeyboardSupported;
// Methods
[Throws] undefined updateRenderState(optional XRRenderStateInit state = {});
Promise<undefined> updateTargetFrameRate(float rate);
Promise<XRReferenceSpace> requestReferenceSpace(XRReferenceSpaceType type);
long requestAnimationFrame(XRFrameRequestCallback callback);
@ -49,6 +54,7 @@ interface XRSession : EventTarget {
attribute EventHandler onsqueezestart;
attribute EventHandler onsqueezeend;
attribute EventHandler onvisibilitychange;
attribute EventHandler onframeratechange;
// AR Module
// Attributes